mirror of
https://github.com/gnustep/libs-back.git
synced 2025-04-23 08:07:07 +00:00
Compare commits
14 commits
master
...
keysight_h
Author | SHA1 | Date | |
---|---|---|---|
|
20d678fe9f | ||
|
9fb73782e0 | ||
|
4ed9301961 | ||
|
544cf2eb2a | ||
|
d23c85132b | ||
|
29e2fa95ae | ||
|
354f323344 | ||
|
8e6a546d05 | ||
|
5e030e7505 | ||
|
cbc6e7f66f | ||
|
78a80fe920 | ||
|
49cefc8df9 | ||
|
4030602b66 | ||
|
4c8524a209 |
58 changed files with 3789 additions and 1575 deletions
47
.github/workflows/main.yml
vendored
47
.github/workflows/main.yml
vendored
|
@ -1,47 +0,0 @@
|
|||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
########### Linux ###########
|
||||
linux:
|
||||
name: ci
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
container:
|
||||
image: ubuntu:22.04
|
||||
|
||||
# don't run pull requests from local branches twice
|
||||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- server: x11
|
||||
graphics: cairo
|
||||
- server: x11
|
||||
graphics: xlib
|
||||
- server: headless
|
||||
graphics: headless
|
||||
|
||||
env:
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install packages
|
||||
run: |
|
||||
apt-get -q -y update
|
||||
apt-get -q -y install libgnustep-gui-dev libfreetype-dev libcairo2-dev libxt-dev pkg-config build-essential
|
||||
|
||||
- name: Build source
|
||||
run: |
|
||||
. /usr/share/GNUstep/Makefiles/GNUstep.sh
|
||||
./configure --enable-server=${{ matrix.server }} --enable-graphics=${{ matrix.graphics }}
|
||||
make && make install
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
. /usr/share/GNUstep/Makefiles/GNUstep.sh
|
||||
make check
|
25
ANNOUNCE
25
ANNOUNCE
|
@ -1,7 +1,7 @@
|
|||
1 Announcement
|
||||
**************
|
||||
|
||||
This is version 0.32.0 of the GNUstep GUI Backend (‘gnustep-back’).
|
||||
This is version 0.29.0 of the GNUstep GUI Backend ('gnustep-back').
|
||||
|
||||
1.1 What is the GNUstep GUI Backend?
|
||||
====================================
|
||||
|
@ -20,27 +20,32 @@ easily ported to other display systems.
|
|||
Window's Systems. It works via a DPS emulation engine to emulate the
|
||||
DPS functions required by the front-end system.
|
||||
|
||||
1.2 Noteworthy changes in version ‘0.32.0’
|
||||
1.2 Noteworthy changes in version '0.29.0'
|
||||
==========================================
|
||||
|
||||
The release includes mostly bug fixes.
|
||||
The release includes an alpha version of the wayland backend and a few
|
||||
bug fixes.
|
||||
|
||||
• Make window termination saver.
|
||||
• Use default interpolation in Cairo.
|
||||
• Allow UTF-8 input from XLookupString.
|
||||
• Improve building on MS Windows.
|
||||
* Alpha version of the wayland backend.
|
||||
* Improved focus handling for WindowMaker interaction.
|
||||
* Speed up for font pattern resolving.
|
||||
* Improved appicon behavior under WindowMaker.
|
||||
* Prevent appicon flickering on WindowMaker at application start.
|
||||
* On Windows, consistently use 'GetWindowLongPtr' and
|
||||
'SetWindowLongPtr' in place of 'GetWindowLong' and 'SetWindowLong'
|
||||
for win32 and cairo for various win64 fixes.
|
||||
|
||||
1.3 Where can you get it? How can you compile it?
|
||||
=================================================
|
||||
|
||||
The gnustep-back-0.32.0.tar.gz distribution file has been placed at
|
||||
The gnustep-back-0.29.0.tar.gz distribution file has been placed at
|
||||
<ftp://ftp.gnustep.org/pub/gnustep/core>.
|
||||
|
||||
It is accompanied by gnustep-back-0.32.0.tar.gz.sig, a PGP signature
|
||||
It is accompanied by gnustep-back-0.29.0.tar.gz.sig, a PGP signature
|
||||
which you can validate by putting both files in the same directory and
|
||||
using:
|
||||
|
||||
gpg --verify gnustep-back-0.32.0.tar.gz.sig
|
||||
gpg --verify gnustep-back-0.29.0.tar.gz.sig
|
||||
|
||||
Signature has been created using the key with the following
|
||||
fingerprint:
|
||||
|
|
17
ChangeLog
17
ChangeLog
|
@ -1,20 +1,3 @@
|
|||
2025-02-11 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* ANNOUNCE:
|
||||
* INSTALL:
|
||||
* NEWS:
|
||||
* README:
|
||||
* Version: bump to 0.32.0
|
||||
New release
|
||||
|
||||
2024-05-26 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* ChangeLog: Update for new release
|
||||
* ANNOUNCE:
|
||||
* NEWS:
|
||||
* Documentation/news.texi: Update of release notes for 0.31.0.
|
||||
* Version: bump to 0.31.0
|
||||
|
||||
2022-12-29 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* ChangeLog: Update for new release
|
||||
|
|
|
@ -7,30 +7,6 @@
|
|||
@include version.texi
|
||||
@end ifset
|
||||
|
||||
@section Noteworthy changes in version @samp{0.32.0}
|
||||
|
||||
The release includes mostly bug fixes.
|
||||
|
||||
@itemize @bullet
|
||||
@item Make window termination saver.
|
||||
@item Use default interpolation in Cairo.
|
||||
@item Allow UTF-8 input from XLookupString.
|
||||
@item Improve building on MS Windows.
|
||||
@end itemize
|
||||
|
||||
@ifclear ANNOUNCE-ONLY
|
||||
|
||||
@section Noteworthy changes in version @samp{0.31.0}
|
||||
|
||||
The release includes mostly improvements for pasteboard handling and a few bug fixes.
|
||||
|
||||
@itemize @bullet
|
||||
@item Improve font name creation.
|
||||
@item Add headless backend.
|
||||
@item Add CI pipeline.
|
||||
@end itemize
|
||||
|
||||
|
||||
@section Noteworthy changes in version @samp{0.30.0}
|
||||
|
||||
The release includes mostly improvements for the new Wayland backend and a few bug fixes.
|
||||
|
@ -42,6 +18,7 @@ The release includes mostly improvements for the new Wayland backend and a few
|
|||
and at every Notify.
|
||||
@end itemize
|
||||
|
||||
@ifclear ANNOUNCE-ONLY
|
||||
|
||||
@section Noteworthy changes in version @samp{0.29.0}
|
||||
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
|
||||
Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
|
||||
August 31, 2003
|
||||
Written by Banlu Kemiyatorn <id at project-ile dot net>
|
||||
|
||||
This file is part of GNUstep.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
|
@ -17,8 +20,8 @@
|
|||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; see the file COPYING.LIB.
|
||||
If not, see <http://www.gnu.org/licenses/> or write to the
|
||||
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
If not, see <http://www.gnu.org/licenses/> or write to the
|
||||
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
|
@ -28,6 +31,8 @@
|
|||
#include "gsc/GSContext.h"
|
||||
|
||||
@interface HeadlessContext : GSContext
|
||||
{
|
||||
}
|
||||
@end
|
||||
|
||||
#endif /* HeadlessContext_h */
|
||||
#endif
|
|
@ -1,11 +1,13 @@
|
|||
/*
|
||||
HeadlessFaceInfo.h
|
||||
CairoFaceInfo.h
|
||||
|
||||
Copyright (C) 2003, 2023 Free Software Foundation, Inc.
|
||||
Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
|
||||
Based on work by: Banlu Kemiyatorn <object at gmail dot com>
|
||||
Based on work by: Alexander Malmberg <alexander@malmberg.org>
|
||||
Based on work by: Fred Kiefer <fredkiefer@gmx.de>
|
||||
August 31, 2003
|
||||
Written by Banlu Kemiyatorn <object at gmail dot com>
|
||||
Base on code by Alexander Malmberg <alexander@malmberg.org>
|
||||
Rewrite: Fred Kiefer <fredkiefer@gmx.de>
|
||||
Date: Jan 2006
|
||||
|
||||
This file is part of GNUstep.
|
||||
|
||||
|
@ -21,13 +23,13 @@
|
|||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; see the file COPYING.LIB.
|
||||
If not, see <http://www.gnu.org/licenses/> or write to the
|
||||
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
If not, see <http://www.gnu.org/licenses/> or write to the
|
||||
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef HeadlessFaceInfo_h
|
||||
#define HeadlessFaceInfo_h
|
||||
#ifndef HEADLESSFACEINFO_H
|
||||
#define HEADLESSFACEINFO_H
|
||||
|
||||
#include <Foundation/NSObject.h>
|
||||
|
||||
|
@ -39,4 +41,4 @@
|
|||
- (void *)fontFace;
|
||||
|
||||
@end
|
||||
#endif /* HeadlessFaceInfo_h */
|
||||
#endif
|
|
@ -1,9 +1,9 @@
|
|||
/*
|
||||
HeadlessFontEnumeartorInfo.h
|
||||
CairoFontEnumerator.h
|
||||
|
||||
Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
|
||||
Based on work by: Banlu Kemiyatorn <object at gmail dot com>
|
||||
August 31, 2003
|
||||
Written by Banlu Kemiyatorn <object at gmail dot com>
|
||||
|
||||
This file is part of GNUstep.
|
||||
|
||||
|
@ -19,17 +19,18 @@
|
|||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; see the file COPYING.LIB.
|
||||
If not, see <http://www.gnu.org/licenses/> or write to the
|
||||
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
If not, see <http://www.gnu.org/licenses/> or write to the
|
||||
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef HeadlessFontEnumerator_h
|
||||
#define HeadlessFontEnumerator_h
|
||||
|
||||
#ifndef CairoFontEnumerator_h
|
||||
#define CairoFontEnumerator_h
|
||||
|
||||
#include <GNUstepGUI/GSFontInfo.h>
|
||||
|
||||
#include "headless/HeadlessFaceInfo.h"
|
||||
@class HeadlessFaceInfo;
|
||||
|
||||
@interface HeadlessFontEnumerator : GSFontEnumerator
|
||||
{
|
||||
|
@ -38,4 +39,4 @@
|
|||
+ (HeadlessFaceInfo *) fontWithName: (NSString *)name;
|
||||
@end
|
||||
|
||||
#endif /* HeadlessFontEnumerator_h */
|
||||
#endif
|
|
@ -1,9 +1,10 @@
|
|||
/*
|
||||
HeadlessFontInfo.h
|
||||
CairoFontInfo.h
|
||||
|
||||
Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
|
||||
Based on work by: Banlu Kemiyatorn <object at gmail dot com>
|
||||
August 31, 2003
|
||||
Written by Banlu Kemiyatorn <object at gmail dot com>
|
||||
|
||||
This file is part of GNUstep.
|
||||
|
||||
|
@ -19,8 +20,8 @@
|
|||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; see the file COPYING.LIB.
|
||||
If not, see <http://www.gnu.org/licenses/> or write to the
|
||||
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
If not, see <http://www.gnu.org/licenses/> or write to the
|
||||
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
|
@ -28,8 +29,19 @@
|
|||
#define HeadlessFontInfo_h
|
||||
|
||||
#include <GNUstepGUI/GSFontInfo.h>
|
||||
#include "headlesslib/HeadlessFaceInfo.h"
|
||||
|
||||
typedef void *cairo_t;
|
||||
|
||||
@interface HeadlessFontInfo : GSFontInfo
|
||||
{
|
||||
@public
|
||||
void *_scaled;
|
||||
}
|
||||
|
||||
- (void) drawGlyphs: (const NSGlyph*)glyphs
|
||||
length: (int)length
|
||||
on: (cairo_t*)ct;
|
||||
@end
|
||||
|
||||
#endif /* HeadlessFontInfo_h */
|
||||
#endif
|
|
@ -1,9 +1,7 @@
|
|||
/*
|
||||
HeadlessGState.h
|
||||
|
||||
Copyright (C) 2004 Free Software Foundation, Inc.
|
||||
|
||||
Based on work by: Banlu Kemiyatorn <object at gmail dot com>
|
||||
Author: Banlu Kemiyatorn <object at gmail dot com>
|
||||
|
||||
This file is part of GNUstep.
|
||||
|
||||
|
@ -19,8 +17,8 @@
|
|||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; see the file COPYING.LIB.
|
||||
If not, see <http://www.gnu.org/licenses/> or write to the
|
||||
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
If not, see <http://www.gnu.org/licenses/> or write to the
|
||||
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
|
@ -29,9 +27,20 @@
|
|||
|
||||
#include "gsc/GSGState.h"
|
||||
|
||||
|
||||
@class HeadlessSurface;
|
||||
|
||||
@interface HeadlessGState : GSGState
|
||||
{
|
||||
@public
|
||||
void *_ct;
|
||||
HeadlessSurface *_surface;
|
||||
}
|
||||
|
||||
- (void) GSCurrentSurface: (HeadlessSurface **)surface : (int *)x : (int *)y;
|
||||
- (void) GSSetSurface: (HeadlessSurface *)surface : (int)x : (int)y;
|
||||
|
||||
- (void) showPage;
|
||||
@end
|
||||
|
||||
#endif /* HeadlessGState_h */
|
||||
#endif
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
HeadlessServer.h
|
||||
Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
|
||||
Copyright (C) 2002-2015 Free Software Foundation, Inc.
|
||||
Author: Eric Wasylishen <ewasylishen@gmail.com>
|
||||
|
||||
This file is part of GNUstep.
|
||||
|
||||
|
@ -17,21 +17,21 @@
|
|||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; see the file COPYING.LIB.
|
||||
If not, see <http://www.gnu.org/licenses/> or write to the
|
||||
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
If not, see <http://www.gnu.org/licenses/> or write to the
|
||||
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef HeadlessServer_h
|
||||
#define HeadlessServer_h
|
||||
#ifndef HeadlessModernSurface_h
|
||||
#define HeadlessModernSurface_h
|
||||
|
||||
#include "config.h"
|
||||
#include "headlesslib/HeadlessSurface.h"
|
||||
|
||||
#include <GNUstepGUI/GSDisplayServer.h>
|
||||
|
||||
@interface HeadlessServer : GSDisplayServer
|
||||
@interface HeadlessModernSurface : HeadlessSurface
|
||||
{
|
||||
@private
|
||||
void *_windowSurface;
|
||||
}
|
||||
@end
|
||||
|
||||
#endif /* HeadlessServer_h */
|
||||
#endif
|
52
Headers/headlesslib/HeadlessSurface.h
Normal file
52
Headers/headlesslib/HeadlessSurface.h
Normal file
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||
|
||||
Author: Banlu Kemiyatorn <object at gmail dot com>
|
||||
|
||||
This file is part of GNUstep.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; see the file COPYING.LIB.
|
||||
If not, see <http://www.gnu.org/licenses/> or write to the
|
||||
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef HeadlessSurface_h
|
||||
#define HeadlessSurface_h
|
||||
|
||||
#include <Foundation/Foundation.h>
|
||||
|
||||
typedef void *cairo_surface_t;
|
||||
|
||||
@interface HeadlessSurface : NSObject
|
||||
{
|
||||
@public
|
||||
void *gsDevice;
|
||||
void *_surface;
|
||||
}
|
||||
|
||||
- (id) initWithDevice: (void *)device;
|
||||
|
||||
- (NSSize) size;
|
||||
- (void) setSize: (NSSize)newSize;
|
||||
|
||||
- (void *) surface;
|
||||
|
||||
- (void) handleExposeRect: (NSRect)rect;
|
||||
|
||||
- (BOOL) isDrawingToScreen;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
157
Headers/xheadless/HeadlessGeneric.h
Normal file
157
Headers/xheadless/HeadlessGeneric.h
Normal file
|
@ -0,0 +1,157 @@
|
|||
/* Generic header info common to X backends for GNUstep
|
||||
|
||||
Copyright (C) 2000 Free Software Foundation, Inc.
|
||||
|
||||
Written by: Richard Frith-Macdonald <rfm@gnu.org>
|
||||
Date: Mar 2000
|
||||
|
||||
This file is part of the GNUstep project
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; see the file COPYING.LIB.
|
||||
If not, see <http://www.gnu.org/licenses/> or write to the
|
||||
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDED_HeadlessGENERIC_H
|
||||
#define INCLUDED_HeadlessGENERIC_H
|
||||
|
||||
#include "XHeadless.h"
|
||||
/*
|
||||
* Flags to indicate which protocols the WindowManager follows
|
||||
*/
|
||||
typedef enum {
|
||||
XGWM_UNKNOWN = 0,
|
||||
XGWM_WINDOWMAKER = 1,
|
||||
XGWM_GNOME = 2,
|
||||
XGWM_KDE = 4,
|
||||
XGWM_EWMH = 8
|
||||
} XGWMProtocols;
|
||||
|
||||
typedef struct {
|
||||
Atom win_type_atom;
|
||||
Atom win_desktop_atom;
|
||||
Atom win_normal_atom;
|
||||
Atom win_floating_atom;
|
||||
Atom win_menu_atom;
|
||||
Atom win_dock_atom;
|
||||
Atom win_modal_atom;
|
||||
Atom win_utility_atom;
|
||||
Atom win_splash_atom;
|
||||
Atom win_override_atom;
|
||||
Atom win_topmenu_atom;
|
||||
Atom win_popup_menu_atom;
|
||||
Atom win_dropdown_menu_atom;
|
||||
Atom win_tooltip_atom;
|
||||
Atom win_notification_atom;
|
||||
Atom win_combo_atom;
|
||||
Atom win_dnd_atom;
|
||||
} XGWMWinTypes;
|
||||
|
||||
typedef struct {
|
||||
Atom net_wm_state_atom;
|
||||
Atom net_wm_state_modal_atom;
|
||||
Atom net_wm_state_sticky_atom;
|
||||
Atom net_wm_state_maximized_vert_atom;
|
||||
Atom net_wm_state_maximized_horz_atom;
|
||||
Atom net_wm_state_shaded_atom;
|
||||
Atom net_wm_state_skip_taskbar_atom;
|
||||
Atom net_wm_state_skip_pager_atom;
|
||||
Atom net_wm_state_hidden_atom;
|
||||
Atom net_wm_state_fullscreen_atom;
|
||||
Atom net_wm_state_above_atom;
|
||||
Atom net_wm_state_below_atom;
|
||||
Atom net_wm_state_demands_attention_atom;
|
||||
} XGWMNetStates;
|
||||
|
||||
/*
|
||||
* Frame offsets for window inside parent decoration window.
|
||||
*/
|
||||
typedef struct {
|
||||
short l; // offset from left
|
||||
short r; // offset from right
|
||||
short t; // offset from top
|
||||
short b; // offset from bottom
|
||||
BOOL known; // obtained from Reparent event or just guessed?
|
||||
} Offsets;
|
||||
|
||||
/*
|
||||
* Structure containing ivars that are common to all X backend contexts.
|
||||
*/
|
||||
struct HeadlessGeneric {
|
||||
int wm;
|
||||
struct {
|
||||
unsigned useWindowMakerIcons:1;
|
||||
unsigned appOwnsMiniwindow:1;
|
||||
unsigned doubleParentWindow:1;
|
||||
} flags;
|
||||
// Time of last X event
|
||||
Time lastTime;
|
||||
// Approximate local time for last X event, used to decide
|
||||
// if the last X event time is still valid.
|
||||
NSTimeInterval lastTimeStamp;
|
||||
// last reference time on X server, used to prevent time drift between
|
||||
// local machine and X server.
|
||||
Time baseXServerTime;
|
||||
Time lastClick;
|
||||
Window lastClickWindow;
|
||||
int lastClickX;
|
||||
int lastClickY;
|
||||
Time lastMotion;
|
||||
Atom protocols_atom;
|
||||
Atom delete_win_atom;
|
||||
Atom take_focus_atom;
|
||||
Atom wm_state_atom;
|
||||
Atom net_wm_ping_atom;
|
||||
Atom net_wm_sync_request_atom;
|
||||
Atom net_wm_sync_request_counter_atom;
|
||||
Atom miniaturize_atom;
|
||||
Atom win_decor_atom;
|
||||
Atom titlebar_state_atom;
|
||||
char *rootName;
|
||||
long currentFocusWindow;
|
||||
long desiredFocusWindow;
|
||||
unsigned long focusRequestNumber;
|
||||
unsigned char lMouse;
|
||||
unsigned char mMouse;
|
||||
unsigned char rMouse;
|
||||
unsigned char upMouse;
|
||||
unsigned char downMouse;
|
||||
unsigned char scrollLeftMouse;
|
||||
unsigned char scrollRightMouse;
|
||||
int lMouseMask;
|
||||
int mMouseMask;
|
||||
int rMouseMask;
|
||||
Window appRootWindow;
|
||||
void *cachedWindow; // last gswindow_device_t used.
|
||||
Offsets offsets[16];
|
||||
XGWMWinTypes wintypes;
|
||||
XGWMNetStates netstates;
|
||||
};
|
||||
|
||||
/* GNOME Window layers */
|
||||
#define WIN_LAYER_DESKTOP 0
|
||||
#define WIN_LAYER_BELOW 2
|
||||
#define WIN_LAYER_NORMAL 4
|
||||
#define WIN_LAYER_ONTOP 6
|
||||
#define WIN_LAYER_DOCK 8
|
||||
#define WIN_LAYER_ABOVE_DOCK 10
|
||||
#define WIN_LAYER_MENU 12
|
||||
|
||||
/* NET WM State */
|
||||
#define _NET_WM_STATE_REMOVE 0 /* remove/unset property */
|
||||
#define _NET_WM_STATE_ADD 1 /* add/set property */
|
||||
#define _NET_WM_STATE_TOGGLE 2 /* toggle property */
|
||||
|
||||
#endif
|
79
Headers/xheadless/HeadlessInputServer.h
Normal file
79
Headers/xheadless/HeadlessInputServer.h
Normal file
|
@ -0,0 +1,79 @@
|
|||
/* HeadlessInputServer - Keyboard input handling
|
||||
|
||||
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||
|
||||
Author: Adam Fedor <fedor@gnu.org>
|
||||
Date: January 2002
|
||||
|
||||
This file is part of the GNUstep GUI Library.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; see the file COPYING.LIB.
|
||||
If not, see <http://www.gnu.org/licenses/> or write to the
|
||||
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef _GNUstep_H_HeadlessInputServer
|
||||
#define _GNUstep_H_HeadlessInputServer
|
||||
|
||||
#include <AppKit/NSInputServer.h>
|
||||
#include <xheadless/HeadlessServerWindow.h>
|
||||
|
||||
@protocol XInputFiltering
|
||||
- (BOOL) filterEvent: (XEvent *)event;
|
||||
- (NSString *) lookupStringForEvent: (XKeyEvent *)event
|
||||
window: (gswindow_device_t *)window
|
||||
keysym: (KeySym *)keysymptr;
|
||||
@end
|
||||
|
||||
|
||||
@interface XIMInputServer: NSInputServer <XInputFiltering>
|
||||
{
|
||||
id delegate;
|
||||
NSString *server_name;
|
||||
XIM xim;
|
||||
XIMStyle xim_style;
|
||||
|
||||
/* Track the XIC:s and destroy them explicitly to work around an XFree86
|
||||
bug:
|
||||
http://www.xfree86.org/pipermail/xpert/2002-June/018370.html
|
||||
*/
|
||||
XIC *xics;
|
||||
int num_xics;
|
||||
}
|
||||
|
||||
- (id) initWithDelegate: (id)aDelegate
|
||||
display: (Display *)dpy
|
||||
name: (NSString *)name;
|
||||
- (void) ximFocusICWindow: (gswindow_device_t *)windev;
|
||||
- (void) ximCloseIC: (XIC)xic;
|
||||
|
||||
@end
|
||||
|
||||
// Public interface for the input methods
|
||||
@interface XIMInputServer (InputMethod)
|
||||
- (NSString *) inputMethodStyle;
|
||||
- (NSString *) fontSize: (int *)size;
|
||||
- (BOOL) clientWindowRect: (NSRect *)rect;
|
||||
|
||||
- (BOOL) statusArea: (NSRect *)rect;
|
||||
- (BOOL) preeditArea: (NSRect *)rect;
|
||||
- (BOOL) preeditSpot: (NSPoint *)p;
|
||||
|
||||
- (BOOL) setStatusArea: (NSRect *)rect;
|
||||
- (BOOL) setPreeditArea: (NSRect *)rect;
|
||||
- (BOOL) setPreeditSpot: (NSPoint *)p;
|
||||
@end // XIMInputServer (InputMethod)
|
||||
|
||||
#endif
|
79
Headers/xheadless/HeadlessOpenGL.h
Normal file
79
Headers/xheadless/HeadlessOpenGL.h
Normal file
|
@ -0,0 +1,79 @@
|
|||
/* -*-ObjC-*- */
|
||||
/* HeadlessOpenGL - openGL management using glX
|
||||
|
||||
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||
|
||||
Author: Frederic De Jaeger
|
||||
Date: Nov 2002
|
||||
|
||||
This file is part of the GNUstep GUI Library.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; see the file COPYING.LIB.
|
||||
If not, see <http://www.gnu.org/licenses/> or write to the
|
||||
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef _GNUstep_H_HeadlessOpenGL_
|
||||
#define _GNUstep_H_HeadlessOpenGL_
|
||||
|
||||
#include <AppKit/NSOpenGL.h>
|
||||
|
||||
#define id _gs_avoid_id_collision
|
||||
#define BOOL XWINDOWSBOOL
|
||||
#include <GL/glx.h>
|
||||
#undef id
|
||||
#undef BOOL
|
||||
|
||||
@class NSView;
|
||||
@class HeadlessXSubWindow;
|
||||
@class HeadlessGLPixelFormat;
|
||||
|
||||
@interface HeadlessGLContext : NSOpenGLContext
|
||||
{
|
||||
int glxminorversion;
|
||||
GLXContext glx_context;
|
||||
GLXWindow glx_drawable;
|
||||
HeadlessXSubWindow *xSubWindow;
|
||||
HeadlessGLPixelFormat *pixelFormat;
|
||||
BOOL saved_ignores_backing;
|
||||
}
|
||||
|
||||
- (GLXContext)glxcontext;
|
||||
|
||||
@end
|
||||
|
||||
@interface HeadlessGLPixelFormat : NSOpenGLPixelFormat
|
||||
{
|
||||
Display * display;
|
||||
int glxminorversion;
|
||||
|
||||
GLXFBConfig *fbconfig;
|
||||
int pickedFBConfig;
|
||||
int configurationCount;
|
||||
BOOL shouldRequestARGBVisual;
|
||||
|
||||
XVisualInfo *visualinfo;
|
||||
|
||||
}
|
||||
|
||||
+ (int) glxMinorVersion;
|
||||
- (Display *) display;
|
||||
- (XVisualInfo *) visualinfo;
|
||||
- (GLXContext) createGLXContext: (HeadlessGLContext *)share;
|
||||
- (GLXWindow) drawableForWindow: (Window)xwindowid;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
113
Headers/xheadless/HeadlessServer.h
Normal file
113
Headers/xheadless/HeadlessServer.h
Normal file
|
@ -0,0 +1,113 @@
|
|||
/* <title>HeadlessServer</title>
|
||||
|
||||
<abstract>Backend server using the X11.</abstract>
|
||||
|
||||
Copyright (C) 2002-2015 Free Software Foundation, Inc.
|
||||
|
||||
Author: Adam Fedor <fedor@gnu.org>
|
||||
Date: Mar 2002
|
||||
|
||||
This file is part of the GNUstep Backend.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; see the file COPYING.LIB.
|
||||
If not, see <http://www.gnu.org/licenses/> or write to the
|
||||
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef _HeadlessServer_h_INCLUDE
|
||||
#define _HeadlessServer_h_INCLUDE
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <GNUstepGUI/GSDisplayServer.h>
|
||||
#include "XHeadless.h"
|
||||
#include "HeadlessGeneric.h"
|
||||
|
||||
/*
|
||||
* Enumerated type to say how we should draw pixels to the X display - used
|
||||
* to select different drawing mechanisms to try to optimise.
|
||||
*/
|
||||
typedef enum {
|
||||
XGDM_FAST15,
|
||||
XGDM_FAST16,
|
||||
XGDM_FAST32,
|
||||
XGDM_FAST32_BGR,
|
||||
XGDM_FAST8,
|
||||
XGDM_PORTABLE
|
||||
} XGDrawMechanism;
|
||||
|
||||
@interface HeadlessServer : GSDisplayServer
|
||||
{
|
||||
Display *dpy;
|
||||
int defScreen;
|
||||
NSMapTable *screenList;
|
||||
Window grabWindow;
|
||||
struct HeadlessGeneric generic;
|
||||
id inputServer;
|
||||
}
|
||||
|
||||
+ (Display*) currentXDisplay;
|
||||
- (Display*) xDisplay;
|
||||
- (Window) xAppRootWindow;
|
||||
|
||||
- (void *) xrContextForScreen: (int)screen_number;
|
||||
- (Visual *) visualForScreen: (int)screen_number;
|
||||
- (int) depthForScreen: (int)screen_number;
|
||||
|
||||
- (XGDrawMechanism) drawMechanismForScreen: (int)screen_number;
|
||||
- (void) getForScreen: (int)screen_number pixelFormat: (int *)bpp_number
|
||||
masks: (int *)red_mask : (int *)green_mask : (int *)blue_mask;
|
||||
- (Window) xDisplayRootWindowForScreen: (int)screen_number;
|
||||
- (XColor) xColorFromColor: (XColor)color forScreen: (int)screen_number;
|
||||
|
||||
+ (void) waitAllContexts;
|
||||
@end
|
||||
|
||||
/*
|
||||
* Synchronize with X event queue - soak up events.
|
||||
* Waits for up to 1 second for event.
|
||||
*/
|
||||
@interface HeadlessServer (XSync)
|
||||
- (BOOL) xSyncMap: (void*)window;
|
||||
@end
|
||||
|
||||
@interface HeadlessServer (HeadlessGeneric)
|
||||
- (NSRect) _OSFrameToXFrame: (NSRect)o for: (void*)window;
|
||||
- (NSRect) _OSFrameToXHints: (NSRect)o for: (void*)window;
|
||||
- (NSRect) _XFrameToOSFrame: (NSRect)x for: (void*)window;
|
||||
- (NSRect) _XFrameToXHints: (NSRect)o for: (void*)window;
|
||||
@end
|
||||
|
||||
// Public interface for the input methods.
|
||||
@interface HeadlessServer (InputMethod)
|
||||
- (NSString *) inputMethodStyle;
|
||||
- (NSString *) fontSize: (int *)size;
|
||||
- (BOOL) clientWindowRect: (NSRect *)rect;
|
||||
|
||||
- (BOOL) statusArea: (NSRect *)rect;
|
||||
- (BOOL) preeditArea: (NSRect *)rect;
|
||||
- (BOOL) preeditSpot: (NSPoint *)p;
|
||||
|
||||
- (BOOL) setStatusArea: (NSRect *)rect;
|
||||
- (BOOL) setPreeditArea: (NSRect *)rect;
|
||||
- (BOOL) setPreeditSpot: (NSPoint *)p;
|
||||
@end
|
||||
|
||||
@interface HeadlessServer (TimeKeeping)
|
||||
- (void) setLastTime: (Time)last;
|
||||
- (Time) lastTime;
|
||||
@end
|
||||
|
||||
#endif /* _HeadlessServer_h_INCLUDE */
|
140
Headers/xheadless/HeadlessServerWindow.h
Normal file
140
Headers/xheadless/HeadlessServerWindow.h
Normal file
|
@ -0,0 +1,140 @@
|
|||
/* Window ops for X11 server
|
||||
|
||||
Copyright (C) 1999-2015 Free Software Foundation, Inc.
|
||||
|
||||
Written by: Adam Fedor <fedor@gnu.org>
|
||||
Date: Nov 1999
|
||||
|
||||
This file is part of the GNU Objective C User Interface library.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; see the file COPYING.LIB.
|
||||
If not, see <http://www.gnu.org/licenses/> or write to the
|
||||
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef _HeadlessServerWindow_h_INCLUDE
|
||||
#define _HeadlessServerWindow_h_INCLUDE
|
||||
|
||||
#include <xheadless/HeadlessServer.h>
|
||||
|
||||
/*
|
||||
* WindowMaker window manager interaction
|
||||
*
|
||||
* NB. Despite the fact that all the fields in this table are notionally
|
||||
* 32bit values (WindowMaker defines them as CARD32 and Pixmap types and
|
||||
* the X protocol spec says Pixmap is 32bits) they actually all have to be
|
||||
* long values (64bits on a 64bit processor). This is because of a bug in
|
||||
* X-windows property functions, such that they assume that where property
|
||||
* data is specified as 32bit it is actually a long.
|
||||
* The X headers automatically adjust the size of a Pixmap to be that of
|
||||
* a long, so we can declare Pixmap fields to be that size, but we must
|
||||
* explicitly use 'unsigned long' rather than CARD32 foir the others.
|
||||
*/
|
||||
typedef struct {
|
||||
unsigned long flags;
|
||||
unsigned long window_style;
|
||||
unsigned long window_level;
|
||||
unsigned long reserved;
|
||||
Pixmap miniaturize_pixmap; // pixmap for miniaturize button
|
||||
Pixmap close_pixmap; // pixmap for close button
|
||||
Pixmap miniaturize_mask; // miniaturize pixmap mask
|
||||
Pixmap close_mask; // close pixmap mask
|
||||
unsigned long extra_flags;
|
||||
} GNUstepWMAttributes;
|
||||
|
||||
#define GSWindowStyleAttr (1<<0)
|
||||
#define GSWindowLevelAttr (1<<1)
|
||||
#define GSMiniaturizePixmapAttr (1<<3)
|
||||
#define GSClosePixmapAttr (1<<4)
|
||||
#define GSMiniaturizeMaskAttr (1<<5)
|
||||
#define GSCloseMaskAttr (1<<6)
|
||||
#define GSExtraFlagsAttr (1<<7)
|
||||
|
||||
#define GSDocumentEditedFlag (1<<0)
|
||||
#define GSWindowWillResizeNotificationsFlag (1<<1)
|
||||
#define GSWindowWillMoveNotificationsFlag (1<<2)
|
||||
#define GSNoApplicationIconFlag (1<<5)
|
||||
#define WMFHideOtherApplications 10
|
||||
#define WMFHideApplication 12
|
||||
|
||||
#define GSMaxWMProtocols 5
|
||||
|
||||
/* Graphics Driver protocol. Setup in [NSGraphicsContext-contextDevice:] */
|
||||
enum {
|
||||
GDriverHandlesBacking = 1,
|
||||
GDriverHandlesExpose = 2
|
||||
};
|
||||
|
||||
typedef struct _gswindow_device_t {
|
||||
Display *display; /* Display this window is on */
|
||||
Window ident; /* Window handle */
|
||||
Window root; /* Handle of root window */
|
||||
Window parent; /* Handle of parent window */
|
||||
int screen; /* Screeen this window is on */
|
||||
GC gc; /* GC for drawing */
|
||||
long number; /* Globally unique identifier */
|
||||
unsigned int depth; /* Window depth */
|
||||
unsigned int border; /* Border size */
|
||||
int map_state; /* X map state */
|
||||
int visibility; /* X visibility */
|
||||
int wm_state; /* X WM state */
|
||||
NSBackingStoreType type; /* Backing type */
|
||||
NSRect xframe; /* Window frame */
|
||||
|
||||
unsigned int buffer_width; /* Size in pixels of the current buffers. */
|
||||
unsigned int buffer_height;
|
||||
Drawable buffer; /* Backing store pixmap */
|
||||
Drawable alpha_buffer; /* Alpha buffer. Managed by gdriver
|
||||
will be freed if HandlesBacking=0 */
|
||||
BOOL is_exposed;
|
||||
NSMutableArray *exposedRects; /* List of exposure event rects */
|
||||
Region region; /* Used between several expose events */
|
||||
XWMHints gen_hints;
|
||||
XSizeHints siz_hints;
|
||||
GNUstepWMAttributes win_attrs;
|
||||
XSetWindowAttributes xwn_attrs;
|
||||
int xoff;
|
||||
int yoff;
|
||||
int boff;
|
||||
Atom protocols[GSMaxWMProtocols];
|
||||
int numProtocols;
|
||||
XIC ic;
|
||||
void *gdriver; /* gdriver ident. Managed by gdriver */
|
||||
int gdriverProtocol; /* Managed by gdriver */
|
||||
BOOL ignore_take_focus;
|
||||
} gswindow_device_t;
|
||||
|
||||
#define GET_XDRAWABLE(win) ((win)->buffer ? (win)->buffer: (win)->ident)
|
||||
|
||||
@interface HeadlessServer (DPSWindow)
|
||||
+ (gswindow_device_t *) _windowForXWindow: (Window)xWindow;
|
||||
+ (gswindow_device_t *) _windowForXParent: (Window)xWindow;
|
||||
+ (gswindow_device_t *) _windowWithTag: (NSInteger)windowNumber;
|
||||
- (void) _addExposedRectangle: (XRectangle)rectangle : (NSInteger)win : (BOOL) ignoreBacking;
|
||||
- (void) _processExposedRectangles: (NSInteger)win;
|
||||
- (void) _initializeCursorForXWindow: (Window) win;
|
||||
- (void) _destroyServerWindows;
|
||||
|
||||
/* This needs to go in GSDisplayServer */
|
||||
- (void) _DPSsetcursor: (Cursor)c : (BOOL)set;
|
||||
|
||||
- (int) _wm_state: (Window) win;
|
||||
- (BOOL) _ewmh_isHidden: (Window) win;
|
||||
@end
|
||||
|
||||
extern Pixmap
|
||||
xgps_cursor_mask(Display *xdpy, Drawable draw, const unsigned char *data,
|
||||
int w, int h, int colors);
|
||||
#endif
|
37
Headers/xheadless/XHeadless.h
Normal file
37
Headers/xheadless/XHeadless.h
Normal file
|
@ -0,0 +1,37 @@
|
|||
#ifndef XHeadless_H
|
||||
#define XHeadless_H
|
||||
|
||||
|
||||
typedef unsigned long long Display;
|
||||
typedef unsigned long long Pixmap;
|
||||
typedef unsigned long long Window;
|
||||
typedef unsigned long long Visual;
|
||||
typedef unsigned long long XColor;
|
||||
typedef unsigned long long Time;
|
||||
typedef unsigned long long GC;
|
||||
typedef unsigned long long Drawable;
|
||||
typedef unsigned long long XWMHints;
|
||||
typedef unsigned long long XSizeHints;
|
||||
typedef unsigned long long XSetWindowAttributes;
|
||||
typedef unsigned long long Atom;
|
||||
typedef void *XIC;
|
||||
typedef unsigned long long XIM;
|
||||
typedef unsigned long long XKeySim;
|
||||
typedef unsigned long long RContext;
|
||||
typedef unsigned long long RContextAttributes;
|
||||
typedef unsigned long long Region;
|
||||
typedef unsigned long long XRectangle;
|
||||
typedef unsigned long long Cursor;
|
||||
typedef unsigned long long XEvent;
|
||||
typedef unsigned long long XKeyEvent;
|
||||
typedef unsigned long long XErrorEvent;
|
||||
typedef unsigned long long KeySym;
|
||||
typedef unsigned long long XIMStyle;
|
||||
|
||||
#define None 0
|
||||
#define NormalState 0
|
||||
#define WithdrawnState 0
|
||||
#define IsViewable 0
|
||||
#define False 0
|
||||
|
||||
#endif
|
149
Headers/xheadless/XWindowBuffer.h
Normal file
149
Headers/xheadless/XWindowBuffer.h
Normal file
|
@ -0,0 +1,149 @@
|
|||
/*
|
||||
Copyright (C) 2002, 2005 Free Software Foundation, Inc.
|
||||
|
||||
Author: Alexander Malmberg <alexander@malmberg.org>
|
||||
|
||||
This file is part of GNUstep.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; see the file COPYING.LIB.
|
||||
If not, see <http://www.gnu.org/licenses/> or write to the
|
||||
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef XWindowBuffer_h
|
||||
#define XWindowBuffer_h
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#define XShmSegmentInfo int
|
||||
|
||||
typedef unsigned long long XImage;
|
||||
typedef unsigned char Bool;
|
||||
|
||||
struct XWindowBuffer_depth_info_s
|
||||
{
|
||||
/* The drawing depth according to X. Usually the number of bits of color
|
||||
data in each pixel. */
|
||||
int drawing_depth;
|
||||
|
||||
/* The number of bytes used by a pixel. There is generally no
|
||||
relationship between this and drawing_depth, except that
|
||||
bytes_per_pixel*8>=drawing_depth. (Eg. 32-bit modes usually have a
|
||||
drawing depth of 24.) */
|
||||
int bytes_per_pixel;
|
||||
|
||||
/* If alpha is to be stored inside the normal data, this should be YES.
|
||||
Otherwise, a separate buffer will be allocated for the alpha data (which
|
||||
never does any harm, but it wastes memory if there's enough space in a
|
||||
pixel, as in 32-bit modes. There needs to be 8 bits available for alpha
|
||||
data at a byte boundary for this to work, though. (This could be fixed,
|
||||
but in the mean time, just setting inline_alpha to NO is easier.)
|
||||
inline_alpha_ofs should be the offset to the byte in each pixel that
|
||||
holds the alpha value. */
|
||||
BOOL inline_alpha;
|
||||
int inline_alpha_ofs;
|
||||
|
||||
/* The byte order used for the buffer. This must be either MSBFirst or
|
||||
LSBFirst. */
|
||||
int byte_order;
|
||||
};
|
||||
|
||||
/*
|
||||
XWindowBuffer maintains an XImage for a window. Each ARTGState that
|
||||
renders to that window uses the same XWindowBuffer (and thus the same
|
||||
buffer, etc.).
|
||||
|
||||
Many states might render to the same window, so we need to make sure
|
||||
that there's only one XWindowBuffer for each window. */
|
||||
@interface XWindowBuffer : NSObject
|
||||
{
|
||||
@public
|
||||
gswindow_device_t *window;
|
||||
|
||||
@private
|
||||
GC gc;
|
||||
Drawable drawable;
|
||||
XImage *ximage;
|
||||
Display *display;
|
||||
Pixmap pixmap;
|
||||
|
||||
int use_shm;
|
||||
XShmSegmentInfo shminfo;
|
||||
|
||||
|
||||
struct XWindowBuffer_depth_info_s DI;
|
||||
|
||||
|
||||
/* While a XShmPutImage is in progress we don't try to call it
|
||||
again. The pending updates are stored here, and when we get the
|
||||
ShmCompletion event, we handle them. */
|
||||
int pending_put; /* There are pending updates */
|
||||
struct
|
||||
{
|
||||
int x, y, w, h;
|
||||
} pending_rect; /* in this rectangle. */
|
||||
|
||||
int pending_event; /* We're waiting for the ShmCompletion event. */
|
||||
|
||||
|
||||
/* This is for the ugly shape-hack */
|
||||
unsigned char *old_shape;
|
||||
int old_shape_size;
|
||||
|
||||
@public
|
||||
unsigned char *data;
|
||||
int sx, sy;
|
||||
int bytes_per_line, bits_per_pixel, bytes_per_pixel;
|
||||
|
||||
/* If has_alpha is 1 and alpha is NULL, the alpha is stored in data
|
||||
somehow. The drawing mechanism code should know how to deal with
|
||||
it. A separate alpha buffer will always be exactly the right size,
|
||||
so each row is sx bytes long.
|
||||
|
||||
If has_alpha is 0, the window is assumed to be completely opaque.
|
||||
*/
|
||||
unsigned char *alpha;
|
||||
int has_alpha;
|
||||
}
|
||||
|
||||
/*
|
||||
Returns a _retained_ XWindowBuffer for the specified gswindow_device_t.
|
||||
|
||||
The depth info is only used if a new XWindowBuffer needs to be allocated.
|
||||
*/
|
||||
+ windowBufferForWindow: (gswindow_device_t *)awindow
|
||||
depthInfo: (struct XWindowBuffer_depth_info_s *)aDI;
|
||||
|
||||
/*
|
||||
Note that alpha is _not_ guaranteed to exist after this has been called;
|
||||
you still need to check has_alpha. If the call fails, a message will be
|
||||
logged.
|
||||
|
||||
(In ARTGState, I handle failures by simply ignoring the operation that
|
||||
required alpha.)
|
||||
|
||||
The alpha channel is initialized to being completely opaque when first
|
||||
created.
|
||||
*/
|
||||
-(void) needsAlpha;
|
||||
|
||||
-(void) _gotShmCompletion;
|
||||
-(void) _exposeRect: (NSRect)r;
|
||||
+(void) _gotShmCompletion: (Drawable)d;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
#endif
|
12
INSTALL
12
INSTALL
|
@ -5,7 +5,7 @@
|
|||
================
|
||||
|
||||
This file documents the installation of the GNUstep Backend Library,
|
||||
‘gnustep-back’. If you are installing this package as part of the
|
||||
'gnustep-back'. If you are installing this package as part of the
|
||||
GNUstep core package, read the file GNUstep-HOWTO for more complete
|
||||
instructions on how to install the entire GNUstep package (including
|
||||
this library). GNUstep-HOWTO is located at <http://www.gnustep.org>
|
||||
|
@ -15,9 +15,9 @@ this library). GNUstep-HOWTO is located at <http://www.gnustep.org>
|
|||
1.2 Configuration
|
||||
=================
|
||||
|
||||
Configuration is performed by running the ‘configure’ program at a shell
|
||||
Configuration is performed by running the 'configure' program at a shell
|
||||
prompt. You may want to use some of the optional arguments to the
|
||||
‘configure’ program. Type ‘configure --help’ for a list. GNUstep
|
||||
'configure' program. Type 'configure --help' for a list. GNUstep
|
||||
specific options are at the end of this list (if any).
|
||||
|
||||
The backend comes with several different window server and graphics
|
||||
|
@ -27,7 +27,7 @@ choose the art graphical drawing implementation, run
|
|||
|
||||
configure --enable-graphics=art
|
||||
|
||||
Type ‘configure --help’ for a list of graphical drawing
|
||||
Type 'configure --help' for a list of graphical drawing
|
||||
implementations.
|
||||
|
||||
You can also change the name of the backend when configuring it.
|
||||
|
@ -52,8 +52,8 @@ program:
|
|||
|
||||
To compile this library, type make. After this is complete, type make
|
||||
install (make sure you are the root user). Some additional options you
|
||||
can use with make are ‘debug=yes’ to make a debugging version of the
|
||||
library and ‘shared=no’ to make a static version of the library. See
|
||||
can use with make are 'debug=yes' to make a debugging version of the
|
||||
library and 'shared=no' to make a static version of the library. See
|
||||
the gstep-make package for more information on these options.
|
||||
|
||||
1.4 Installing
|
||||
|
|
213
NEWS
213
NEWS
|
@ -1,110 +1,79 @@
|
|||
1 NEWS
|
||||
******
|
||||
|
||||
1.1 Noteworthy changes in version ‘0.32.0’
|
||||
==========================================
|
||||
|
||||
The release includes mostly bug fixes.
|
||||
|
||||
• Make window termination saver.
|
||||
• Use default interpolation in Cairo.
|
||||
• Allow UTF-8 input from XLookupString.
|
||||
• Improve building on MS Windows.
|
||||
|
||||
1.2 Noteworthy changes in version ‘0.31.0’
|
||||
==========================================
|
||||
|
||||
The release includes mostly improvements for pasteboard handling and a
|
||||
few bug fixes.
|
||||
|
||||
• Improve font name creation.
|
||||
• Add headless backend.
|
||||
• Add CI pipeline.
|
||||
|
||||
1.3 Noteworthy changes in version ‘0.30.0’
|
||||
==========================================
|
||||
|
||||
The release includes mostly improvements for the new Wayland backend and
|
||||
a few bug fixes.
|
||||
|
||||
• Improvements for the wayland backend.
|
||||
• Don't use font hinting for cauro, when using scaling.
|
||||
• Fix pasteboard transfer of huge data by deleting property on begin
|
||||
and at every Notify.
|
||||
|
||||
1.4 Noteworthy changes in version ‘0.29.0’
|
||||
1.1 Noteworthy changes in version '0.29.0'
|
||||
==========================================
|
||||
|
||||
The release includes an alpha version of the wayland backend and a few
|
||||
bug fixes.
|
||||
|
||||
• Alpha version of the wayland backend.
|
||||
• Improved focus handling for WindowMaker interaction.
|
||||
• Speed up for font pattern resolving.
|
||||
• Improved appicon behavior under WindowMaker.
|
||||
• Prevent appicon flickering on WindowMaker at application start.
|
||||
• On Windows, consistently use ‘GetWindowLongPtr’ and
|
||||
‘SetWindowLongPtr’ in place of ‘GetWindowLong’ and ‘SetWindowLong’
|
||||
* Alpha version of the wayland backend.
|
||||
* Improved focus handling for WindowMaker interaction.
|
||||
* Speed up for font pattern resolving.
|
||||
* Improved appicon behavior under WindowMaker.
|
||||
* Prevent appicon flickering on WindowMaker at application start.
|
||||
* On Windows, consistently use 'GetWindowLongPtr' and
|
||||
'SetWindowLongPtr' in place of 'GetWindowLong' and 'SetWindowLong'
|
||||
for win32 and cairo for various win64 fixes.
|
||||
|
||||
1.5 Noteworthy changes in version ‘0.28.0’
|
||||
1.2 Noteworthy changes in version '0.28.0'
|
||||
==========================================
|
||||
|
||||
This release includes a few bugfixes and a huge rework of multi monitor
|
||||
handling.
|
||||
|
||||
• Improved focus handling for WindowMaker interaction.
|
||||
• Cursor improvements.
|
||||
• Better handling of fonts with fontconfig.
|
||||
• Simplify code that converts images for X11.
|
||||
• art: Remove ftfont-old.m.
|
||||
• Use Xrandr for multi monitor support.
|
||||
* Improved focus handling for WindowMaker interaction.
|
||||
* Cursor improvements.
|
||||
* Better handling of fonts with fontconfig.
|
||||
* Simplify code that converts images for X11.
|
||||
* art: Remove ftfont-old.m.
|
||||
* Use Xrandr for multi monitor support.
|
||||
|
||||
1.6 Noteworthy changes in version ‘0.27.0’
|
||||
1.3 Noteworthy changes in version '0.27.0'
|
||||
==========================================
|
||||
|
||||
This release includes a few bugfixes.
|
||||
|
||||
• configure: Improve configuration.
|
||||
• xlib: Improve xft font classes.
|
||||
• x11: Enable drawing in secondary threads.
|
||||
• x11: Better handling of atoms. Method to get the window manager.
|
||||
• opal: Improve colour handling
|
||||
* configure: Improve configuration.
|
||||
* xlib: Improve xft font classes.
|
||||
* x11: Enable drawing in secondary threads.
|
||||
* x11: Better handling of atoms. Method to get the window manager.
|
||||
* opal: Improve colour handling
|
||||
|
||||
1.7 Noteworthy changes in version ‘0.26.2’
|
||||
1.4 Noteworthy changes in version '0.26.2'
|
||||
==========================================
|
||||
|
||||
This release contains no changes since 0.26.1. It is released to
|
||||
coincide with gnustep-gui 0.26.2, which has important bugfixes related
|
||||
to printing.
|
||||
|
||||
1.8 Noteworthy changes in version ‘0.26.1’
|
||||
1.5 Noteworthy changes in version '0.26.1'
|
||||
==========================================
|
||||
|
||||
This release contains no changes since 0.26.0. It is released to
|
||||
coincide with gnustep-gui 0.26.1, released to mark gnustep-base 1.25.1
|
||||
as the requirement for gnustep-gui.
|
||||
|
||||
1.9 Noteworthy changes in version ‘0.26.0’
|
||||
1.6 Noteworthy changes in version '0.26.0'
|
||||
==========================================
|
||||
|
||||
This release includes a few bugfixes, as well as compatibility
|
||||
improvements as a result of GSoC 2017 project.
|
||||
|
||||
• opal: Bridging categories between Opal and GNUstep GUI. Added onto
|
||||
* opal: Bridging categories between Opal and GNUstep GUI. Added onto
|
||||
NSColor, NSImage and NSImageRep.
|
||||
• cairo: Get -DPSshow: to work on scaled windows.
|
||||
• opal: Allow creating a NSGraphicsContext with a custom graphics
|
||||
* cairo: Get -DPSshow: to work on scaled windows.
|
||||
* opal: Allow creating a NSGraphicsContext with a custom graphics
|
||||
port, other than a CGContext.
|
||||
• misc: Fix reported static analyser warnings.
|
||||
* misc: Fix reported static analyser warnings.
|
||||
|
||||
1.10 Noteworthy changes in version ‘0.25.1’
|
||||
===========================================
|
||||
1.7 Noteworthy changes in version '0.25.1'
|
||||
==========================================
|
||||
|
||||
Small fixes and cleanups.
|
||||
|
||||
1.11 Noteworthy changes in version ‘0.25.0’
|
||||
===========================================
|
||||
1.8 Noteworthy changes in version '0.25.0'
|
||||
==========================================
|
||||
|
||||
Support for pattern phase, compositing operation, image interpolation
|
||||
and antialiasing per gstate.
|
||||
|
@ -115,28 +84,28 @@ and antialiasing per gstate.
|
|||
|
||||
Various fixes.
|
||||
|
||||
1.12 Noteworthy changes in version ‘0.24.1’
|
||||
===========================================
|
||||
1.9 Noteworthy changes in version '0.24.1'
|
||||
==========================================
|
||||
|
||||
Improvements in win32 display and mouse tracking.
|
||||
|
||||
Various minor bugfixes and cleanups.
|
||||
|
||||
1.13 Noteworthy changes in version ‘0.24.0’
|
||||
1.10 Noteworthy changes in version '0.24.0'
|
||||
===========================================
|
||||
|
||||
Added experimental Opal backend.
|
||||
|
||||
Allow for ARGB visual for OpenGL.
|
||||
|
||||
1.14 Noteworthy changes in version ‘0.23.0’
|
||||
1.11 Noteworthy changes in version '0.23.0'
|
||||
===========================================
|
||||
|
||||
Added cairo support for ms-windows.
|
||||
|
||||
Updated for NSInteger/CGFloat support
|
||||
|
||||
1.15 Noteworthy changes in version ‘0.22.0’
|
||||
1.12 Noteworthy changes in version '0.22.0'
|
||||
===========================================
|
||||
|
||||
Added new user defaults to make app icons and mini windows sticky
|
||||
|
@ -145,7 +114,7 @@ Added new user defaults to make app icons and mini windows sticky
|
|||
Many improvements to Cairo rendering, including buffering, glyphs and
|
||||
DPI scaling.
|
||||
|
||||
1.16 Noteworthy changes in version ‘0.20.0’
|
||||
1.13 Noteworthy changes in version '0.20.0'
|
||||
===========================================
|
||||
|
||||
Cairo is now the default backend, but falls back to art and xlib
|
||||
|
@ -155,37 +124,37 @@ gracefully.
|
|||
|
||||
More Windows improvements.
|
||||
|
||||
1.17 Noteworthy changes in version ‘0.19.0’
|
||||
1.14 Noteworthy changes in version '0.19.0'
|
||||
===========================================
|
||||
|
||||
This is an (unstable) copy of the 0.18.0 release
|
||||
|
||||
1.18 Noteworthy changes in version ‘0.18.0’
|
||||
1.15 Noteworthy changes in version '0.18.0'
|
||||
===========================================
|
||||
|
||||
Many Windows improvements
|
||||
|
||||
Implement pattern colours for all backends.
|
||||
|
||||
1.19 Noteworthy changes in version ‘0.17.1’
|
||||
1.16 Noteworthy changes in version '0.17.1'
|
||||
===========================================
|
||||
|
||||
Use DejaVu as another fallback font.
|
||||
|
||||
1.20 Noteworthy changes in version ‘0.17.0’
|
||||
1.17 Noteworthy changes in version '0.17.0'
|
||||
===========================================
|
||||
|
||||
Key repeat support implemented in X11.
|
||||
|
||||
OpenGL fixes and improvements.
|
||||
|
||||
1.21 Noteworthy changes in version ‘0.16.0’
|
||||
1.18 Noteworthy changes in version '0.16.0'
|
||||
===========================================
|
||||
|
||||
Transparent windows implemented in WIN32 backend, better position and
|
||||
scaling of images. General cleanup of code.
|
||||
|
||||
1.22 Noteworthy changes in version ‘0.14.0’
|
||||
1.19 Noteworthy changes in version '0.14.0'
|
||||
===========================================
|
||||
|
||||
Added code to automatically make any window which uses the
|
||||
|
@ -193,7 +162,7 @@ NSDesktopWindowLevel also be omnipresent.
|
|||
|
||||
Many glyph drawing improvements.
|
||||
|
||||
1.23 Noteworthy changes in version ‘0.13.2’
|
||||
1.20 Noteworthy changes in version '0.13.2'
|
||||
===========================================
|
||||
|
||||
Added basic implementation of window levels on Windows. In general a
|
||||
|
@ -207,24 +176,24 @@ bunch of improvements in the Windows backend.
|
|||
frontend. This version or greater of the backend needs to be used with
|
||||
gui 0.13.2
|
||||
|
||||
1.24 Noteworthy changes in version ‘0.13.1’
|
||||
1.21 Noteworthy changes in version '0.13.1'
|
||||
===========================================
|
||||
|
||||
Minor improvements.
|
||||
|
||||
1.25 Noteworthy changes in version ‘0.13.0’
|
||||
1.22 Noteworthy changes in version '0.13.0'
|
||||
===========================================
|
||||
|
||||
Many improvements to the cairo backend. Add DPSshfill for all backends.
|
||||
Better handling of X event times.
|
||||
|
||||
1.26 Noteworthy changes in version ‘0.12.0’
|
||||
1.23 Noteworthy changes in version '0.12.0'
|
||||
===========================================
|
||||
|
||||
Big improvements to the cairo graphics and Window backend. Also better
|
||||
support for OpenGL.
|
||||
|
||||
1.27 Noteworthy changes in version ‘0.11.0’
|
||||
1.24 Noteworthy changes in version '0.11.0'
|
||||
===========================================
|
||||
|
||||
Bugfixes to art and xlib.
|
||||
|
@ -232,17 +201,17 @@ Bugfixes to art and xlib.
|
|||
There was some work on the Windows backend for the GDI interface by
|
||||
Christopher Armstrong.
|
||||
|
||||
1.28 Noteworthy changes in version ‘0.10.3’
|
||||
1.25 Noteworthy changes in version '0.10.3'
|
||||
===========================================
|
||||
|
||||
Fixes. A lot of Cairo backend work.
|
||||
|
||||
1.29 Noteworthy changes in version ‘0.10.2’
|
||||
1.26 Noteworthy changes in version '0.10.2'
|
||||
===========================================
|
||||
|
||||
The Backend can set UTF8 window titles where this is allowed.
|
||||
|
||||
1.30 Noteworthy changes in version ‘0.10.1’
|
||||
1.27 Noteworthy changes in version '0.10.1'
|
||||
===========================================
|
||||
|
||||
The art graphics module is the default now. As was previously the case,
|
||||
|
@ -259,69 +228,69 @@ Cairo library before it will work with GNUstep. Due to this, this
|
|||
module is still considered beta. Ask on the mailing lists for help with
|
||||
this.
|
||||
|
||||
1.31 Noteworthy changes in version ‘0.10.0’
|
||||
1.28 Noteworthy changes in version '0.10.0'
|
||||
===========================================
|
||||
|
||||
The installed name of the backend now includes an interface version
|
||||
number. This avoids the potential version mismatch between the frontend
|
||||
(GUI) library and the backend.
|
||||
|
||||
• Alpha blending was implemented for Windows, although it does not
|
||||
* Alpha blending was implemented for Windows, although it does not
|
||||
seem to work on some machines.
|
||||
|
||||
1.32 Noteworthy changes in version ‘0.9.5’
|
||||
1.29 Noteworthy changes in version '0.9.5'
|
||||
==========================================
|
||||
|
||||
• Added support for window alpha on X servers.
|
||||
• Add support for old and new freetype libs.
|
||||
• Some improvements to the Windows backend.
|
||||
* Added support for window alpha on X servers.
|
||||
* Add support for old and new freetype libs.
|
||||
* Some improvements to the Windows backend.
|
||||
|
||||
1.33 Noteworthy changes in version ‘0.9.4’
|
||||
1.30 Noteworthy changes in version '0.9.4'
|
||||
==========================================
|
||||
|
||||
• Fast drawing on 8 bit displays was added (although it might only
|
||||
* Fast drawing on 8 bit displays was added (although it might only
|
||||
speed things up on old X11 servers and/or remote servers).
|
||||
• GNUstep modifier keys are mapped to KeySyms instead of KeyCodes
|
||||
• Added a Cairo backend, although it is probably non-functional.
|
||||
* GNUstep modifier keys are mapped to KeySyms instead of KeyCodes
|
||||
* Added a Cairo backend, although it is probably non-functional.
|
||||
Anyone is invited to contribute to making it work.
|
||||
• art backend supports reading from a window.
|
||||
• Add internal window decoration handling.
|
||||
* art backend supports reading from a window.
|
||||
* Add internal window decoration handling.
|
||||
|
||||
1.34 Noteworthy changes in version ‘0.9.3’
|
||||
1.31 Noteworthy changes in version '0.9.3'
|
||||
==========================================
|
||||
|
||||
• A number of W32 window event enhancements
|
||||
• art backend glyph drawing with alpha enhancements.
|
||||
• libwraster is no longer checked for - image functions now in
|
||||
* A number of W32 window event enhancements
|
||||
* art backend glyph drawing with alpha enhancements.
|
||||
* libwraster is no longer checked for - image functions now in
|
||||
frontend
|
||||
|
||||
1.35 Noteworthy changes in version ‘0.9.2’
|
||||
1.32 Noteworthy changes in version '0.9.2'
|
||||
==========================================
|
||||
|
||||
• Art backend added support for grayscale, one-isblack colorspaces.
|
||||
• Windows pasteboard interaction handling added.
|
||||
• Better focus handling on Windows.
|
||||
• Better font and draw handling on Windows.
|
||||
* Art backend added support for grayscale, one-isblack colorspaces.
|
||||
* Windows pasteboard interaction handling added.
|
||||
* Better focus handling on Windows.
|
||||
* Better font and draw handling on Windows.
|
||||
|
||||
1.36 Noteworthy changes in version ‘0.9.1’
|
||||
1.33 Noteworthy changes in version '0.9.1'
|
||||
==========================================
|
||||
|
||||
Color on 8 bit displays works correctly now. WindowMaker properties are
|
||||
always set now in case another manager is emulating WindowMaker styles.
|
||||
|
||||
1.37 Noteworthy changes in version ‘0.9.0’
|
||||
1.34 Noteworthy changes in version '0.9.0'
|
||||
==========================================
|
||||
|
||||
Some more improvements to copy/paste support following ICCCM
|
||||
specifications (like COMPOUND_TEXT support).
|
||||
|
||||
1.38 Noteworthy changes in version ‘0.8.9’
|
||||
1.35 Noteworthy changes in version '0.8.9'
|
||||
==========================================
|
||||
|
||||
• Much improved pasting support between X apps and GNUstep apps.
|
||||
• Backend headers are no longer installed (now private).
|
||||
* Much improved pasting support between X apps and GNUstep apps.
|
||||
* Backend headers are no longer installed (now private).
|
||||
|
||||
1.39 Noteworthy changes in version ‘0.8.8’
|
||||
1.36 Noteworthy changes in version '0.8.8'
|
||||
==========================================
|
||||
|
||||
Full multi-byte/unicode support for East Asian languages was added to
|
||||
|
@ -329,60 +298,60 @@ the xlib backend. The X11 server now supports use of the XIM input
|
|||
method for entering non-keyboard characters. Both contributions thanks
|
||||
to Kazunobu Kuriyama.
|
||||
|
||||
• Also added slightly better EWMH support.
|
||||
• Art backend works with more versions of freetype.
|
||||
* Also added slightly better EWMH support.
|
||||
* Art backend works with more versions of freetype.
|
||||
|
||||
1.40 Noteworthy changes in version ‘0.8.7’
|
||||
1.37 Noteworthy changes in version '0.8.7'
|
||||
==========================================
|
||||
|
||||
Handle NSBezierPath glyph drawing in art backend. art backend compiles
|
||||
with all freetype except 2.1.3 via ifdefs.
|
||||
|
||||
1.41 Noteworthy changes in version ‘0.8.6’
|
||||
1.38 Noteworthy changes in version '0.8.6'
|
||||
==========================================
|
||||
|
||||
Bug fixes. See the gnustep-gui NEWS for changes.
|
||||
|
||||
1.42 Noteworthy changes in version ‘0.8.5’
|
||||
1.39 Noteworthy changes in version '0.8.5'
|
||||
==========================================
|
||||
|
||||
Text system improvements. See the gnustep-gui NEWS for changes.
|
||||
|
||||
1.43 Noteworthy changes in version ‘0.8.3’
|
||||
1.40 Noteworthy changes in version '0.8.3'
|
||||
==========================================
|
||||
|
||||
See the gnustep-gui NEWS for changes.
|
||||
|
||||
1.44 Noteworthy changes in version ‘0.8.2’
|
||||
1.41 Noteworthy changes in version '0.8.2'
|
||||
==========================================
|
||||
|
||||
Improved font handling in art backend. Improved compositing with
|
||||
transformations and clipping in art backend.
|
||||
|
||||
1.45 Noteworthy changes in version ‘0.8.1’
|
||||
1.42 Noteworthy changes in version '0.8.1'
|
||||
==========================================
|
||||
|
||||
art (libart-based) backend added. Use ./configure -enable-graphics=art
|
||||
to choose this backend.
|
||||
|
||||
1.46 Noteworthy changes in version ‘0.8.0’
|
||||
1.43 Noteworthy changes in version '0.8.0'
|
||||
==========================================
|
||||
|
||||
Bug fixes.
|
||||
|
||||
1.47 Noteworthy changes in version ‘0.7.9’
|
||||
1.44 Noteworthy changes in version '0.7.9'
|
||||
==========================================
|
||||
|
||||
Bug fixes.
|
||||
|
||||
1.48 Noteworthy changes in version ‘0.7.8’
|
||||
1.45 Noteworthy changes in version '0.7.8'
|
||||
==========================================
|
||||
|
||||
Simplified backend selection using -enable-server and -enable-graphics.
|
||||
Add -with-library-flags and -with-include-flags for adding additonal
|
||||
flags. Set name with -with-name
|
||||
|
||||
1.49 Noteworthy changes in version ‘0.7.7’
|
||||
1.46 Noteworthy changes in version '0.7.7'
|
||||
==========================================
|
||||
|
||||
First release. Most components extracted from xgps. The old backends,
|
||||
|
|
10
README
10
README
|
@ -1,23 +1,23 @@
|
|||
1 README
|
||||
********
|
||||
|
||||
This is version 0.32.0 of the GNUstep GUI Backend (‘gnustep-back’).
|
||||
This is version 0.29.0 of the GNUstep GUI Backend ('gnustep-back').
|
||||
|
||||
Here is some introductory info to get you started:
|
||||
|
||||
1.1 Initial reading
|
||||
===================
|
||||
|
||||
• The file ‘ANNOUNCE’ contains a very brief overview of the library.
|
||||
* The file 'ANNOUNCE' contains a very brief overview of the library.
|
||||
It also tells you where to get the most recent version.
|
||||
|
||||
• The file ‘NEWS’ has the library's feature history.
|
||||
* The file 'NEWS' has the library's feature history.
|
||||
|
||||
• The file ‘INSTALL’ gives instructions for installing the library.
|
||||
* The file 'INSTALL' gives instructions for installing the library.
|
||||
|
||||
1.2 How can you help?
|
||||
=====================
|
||||
|
||||
• Give us feedback! Tell us what you like; tell us what you think
|
||||
* Give us feedback! Tell us what you like; tell us what you think
|
||||
could be better. Send us bug reports at <bug-gnustep@gnu.org>.
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ endif
|
|||
#
|
||||
# The list of subproject directories
|
||||
#
|
||||
SUBPROJECTS = $(sort gsc $(BUILD_SERVER) $(BUILD_GRAPHICS))
|
||||
SUBPROJECTS = gsc $(BUILD_SERVER) $(BUILD_GRAPHICS)
|
||||
|
||||
libgnustep-$(BACKEND_FULL)_SUBPROJECTS=$(SUBPROJECTS)
|
||||
|
||||
|
|
|
@ -50,8 +50,8 @@
|
|||
@interface WaylandServer (Initialize)
|
||||
+ (void) initializeBackend;
|
||||
@end
|
||||
#elif BUILD_SERVER == SERVER_headless
|
||||
#include <headless/HeadlessServer.h>
|
||||
#elif BUILD_SERVER == SERVER_xheadless
|
||||
#include <xheadless/HeadlessServer.h>
|
||||
@interface HeadlessServer (Initialize)
|
||||
+ (void) initializeBackend;
|
||||
@end
|
||||
|
@ -75,8 +75,8 @@
|
|||
[WIN32Server initializeBackend];
|
||||
#elif BUILD_SERVER == SERVER_wayland
|
||||
[WaylandServer initializeBackend];
|
||||
#elif BUILD_SERVER == SERVER_headless
|
||||
[HeadlessServer initializeBackend];
|
||||
#elif BUILD_SERVER == SERVER_xheadless
|
||||
[HeadlessServer initializeBackend];
|
||||
#else
|
||||
[NSException raise: NSInternalInconsistencyException
|
||||
format: @"No Window Server configured in backend"];
|
||||
|
@ -100,10 +100,10 @@
|
|||
#elif (BUILD_GRAPHICS==GRAPHICS_winlib)
|
||||
context = @"WIN32Context";
|
||||
#elif (BUILD_GRAPHICS==GRAPHICS_cairo)
|
||||
context = @"CairoContext";
|
||||
#elif (BUILD_GRAPHICS==GRAPHICS_opal)
|
||||
context = @"CairoContext";
|
||||
#elif (BUILD_GRAPHICS==GRAPHICS_opal)
|
||||
context = @"OpalContext";
|
||||
#elif (BUILD_GRAPHICS==GRAPHICS_headless)
|
||||
#elif (BUILD_GRAPHICS==GRAPHICS_headlesslib)
|
||||
context = @"HeadlessContext";
|
||||
#else
|
||||
#error INVALID build graphics type
|
||||
|
|
|
@ -57,6 +57,19 @@
|
|||
# endif /* USE_GLITZ */
|
||||
# include "x11/XGServerWindow.h"
|
||||
# include "x11/XWindowBuffer.h"
|
||||
#elif BUILD_SERVER == SERVER_xheadless
|
||||
# include "cairo/CairoGState.h"
|
||||
# include "x11/XGServer.h"
|
||||
# define _CAIRO_GSTATE_CLASSNAME CairoGState
|
||||
# ifdef USE_GLITZ
|
||||
# define _CAIRO_SURFACE_CLASSNAME XGCairoGlitzSurface
|
||||
# include "cairo/XGCairoGlitzSurface.h"
|
||||
# else
|
||||
# define _CAIRO_SURFACE_CLASSNAME XGCairoModernSurface
|
||||
# include "cairo/XGCairoModernSurface.h"
|
||||
# endif /* USE_GLITZ */
|
||||
# include "x11/XGServerWindow.h"
|
||||
# include "x11/XWindowBuffer.h"
|
||||
#elif BUILD_SERVER == SERVER_win32
|
||||
# include "cairo/Win32CairoGState.h"
|
||||
# include <windows.h>
|
||||
|
@ -105,16 +118,6 @@
|
|||
return YES;
|
||||
}
|
||||
|
||||
- (id) initWithContextInfo: (NSDictionary *)info
|
||||
{
|
||||
self = [super initWithContextInfo: info];
|
||||
if (self)
|
||||
{
|
||||
[self setImageInterpolation: NSImageInterpolationDefault];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (BOOL) isDrawingToScreen
|
||||
{
|
||||
CairoSurface *surface = nil;
|
||||
|
|
|
@ -163,20 +163,11 @@ static NSArray *faFromFc(FcPattern *pat)
|
|||
float nsweight;
|
||||
unsigned int nstraits = 0;
|
||||
char *fcfamily, *fcstyle;
|
||||
NSString *styleStr = nil;
|
||||
NSString *name = nil;
|
||||
NSMutableString *family, *style;
|
||||
NSMutableString *name, *family, *style;
|
||||
#ifdef FC_POSTSCRIPT_NAME
|
||||
char *fcname;
|
||||
#endif
|
||||
|
||||
if (FcPatternGetString(pat, FC_STYLE, 0, (FcChar8 **)&fcstyle) == FcResultMatch)
|
||||
{
|
||||
styleStr = [NSString stringWithUTF8String: fcstyle];
|
||||
}
|
||||
|
||||
// NSLog (@"family: %@, style: %s/%@", name, fcstyle, style);
|
||||
|
||||
if (FcPatternGetInteger(pat, FC_WEIGHT, 0, &weight) != FcResultMatch
|
||||
|| FcPatternGetInteger(pat, FC_SLANT, 0, &slant) != FcResultMatch
|
||||
|| FcPatternGetString(pat, FC_FAMILY, 0, (FcChar8 **)&fcfamily)
|
||||
|
@ -187,6 +178,12 @@ static NSArray *faFromFc(FcPattern *pat)
|
|||
if (spacing==FC_MONO || spacing==FC_CHARCELL)
|
||||
nstraits |= NSFixedPitchFontMask;
|
||||
|
||||
name = [NSMutableString stringWithCapacity: 100];
|
||||
#ifdef FC_POSTSCRIPT_NAME
|
||||
if (FcPatternGetString(pat, FC_POSTSCRIPT_NAME, 0, (FcChar8 **)&fcname) == FcResultMatch)
|
||||
[name appendString: [NSMutableString stringWithUTF8String: fcname]];
|
||||
#endif
|
||||
|
||||
family = [NSMutableString stringWithUTF8String: fcfamily];
|
||||
style = [NSMutableString stringWithCapacity: 100];
|
||||
|
||||
|
@ -306,40 +303,28 @@ static NSArray *faFromFc(FcPattern *pat)
|
|||
break;
|
||||
}
|
||||
|
||||
if (styleStr == nil)
|
||||
if (![name length]) // no psname
|
||||
{
|
||||
styleStr = (NSString *)style;
|
||||
}
|
||||
|
||||
if (![styleStr length])
|
||||
{
|
||||
styleStr = @"Regular";
|
||||
}
|
||||
|
||||
#ifdef FC_POSTSCRIPT_NAME
|
||||
if (FcPatternGetString(pat, FC_POSTSCRIPT_NAME, 0, (FcChar8 **)&fcname) == FcResultMatch)
|
||||
{
|
||||
name = [NSString stringWithUTF8String: fcname];
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!name || ![name length]) // no psname
|
||||
{
|
||||
NSMutableString *tmpStr;
|
||||
|
||||
tmpStr = [NSMutableString stringWithCapacity: 100];
|
||||
NSDebugLLog(@"NSFont", @"Warning: synthesizing PSName for '%@ %@'", family, styleStr);
|
||||
[tmpStr appendString: family];
|
||||
if ([styleStr length] > 0 && ![styleStr isEqualToString: @"Regular"])
|
||||
NSDebugLLog(@"NSFont", @"Warning: synthesizing PSName for '%@ %@'", family, style);
|
||||
[name appendString: family];
|
||||
if ([style length] > 0)
|
||||
{
|
||||
[tmpStr appendString: @"-"];
|
||||
[tmpStr appendString: styleStr];
|
||||
}
|
||||
name = [NSString stringWithString: tmpStr];
|
||||
[name appendString: @"-"];
|
||||
[name appendString: style];
|
||||
}
|
||||
}
|
||||
|
||||
if (![style length])
|
||||
{
|
||||
[style setString: @"Regular"];
|
||||
}
|
||||
|
||||
if (FcPatternGetString(pat, FC_STYLE, 0, (FcChar8 **)&fcstyle) == FcResultMatch)
|
||||
style = [NSString stringWithUTF8String: fcstyle];
|
||||
|
||||
// NSLog (@"family: %@, style: %s/%@", name, fcstyle, style);
|
||||
return [NSArray arrayWithObjects: name,
|
||||
styleStr,
|
||||
style,
|
||||
[NSNumber numberWithFloat: nsweight],
|
||||
[NSNumber numberWithUnsignedInt: nstraits],
|
||||
nil];
|
||||
|
|
|
@ -1,45 +0,0 @@
|
|||
/*
|
||||
HeadlessContext.m
|
||||
|
||||
Copyright (C) 2003, 2023 Free Software Foundation, Inc.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; see the file COPYING.LIB.
|
||||
If not, see <http://www.gnu.org/licenses/> or write to the
|
||||
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "headless/HeadlessContext.h"
|
||||
#include "headless/HeadlessFontInfo.h"
|
||||
#include "headless/HeadlessFontEnumerator.h"
|
||||
#include "headless/HeadlessGState.h"
|
||||
|
||||
@implementation HeadlessContext
|
||||
|
||||
+ (void) initializeBackend
|
||||
{
|
||||
[NSGraphicsContext setDefaultContextClass: self];
|
||||
|
||||
[GSFontEnumerator setDefaultClass: [HeadlessFontEnumerator class]];
|
||||
[GSFontInfo setDefaultClass: [HeadlessFontInfo class]];
|
||||
}
|
||||
|
||||
+ (Class) GStateClass
|
||||
{
|
||||
return [HeadlessGState class];
|
||||
}
|
||||
|
||||
@end
|
|
@ -1,72 +0,0 @@
|
|||
/*
|
||||
HeadlessGState.m
|
||||
|
||||
Copyright (C) 2003, 2023 Free Software Foundation, Inc.
|
||||
|
||||
Based on work by: Marcian Lytwyn <gnustep@advcsi.com> for Keysight
|
||||
Based on work by: Banlu Kemiyatorn <object at gmail dot com>
|
||||
Based on work by: Fred Kiefer <fredkiefer@gmx.de>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; see the file COPYING.LIB.
|
||||
If not, see <http://www.gnu.org/licenses/> or write to the
|
||||
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "headless/HeadlessGState.h"
|
||||
|
||||
@implementation HeadlessGState
|
||||
|
||||
- (void) DPSclip
|
||||
{
|
||||
}
|
||||
|
||||
- (void) DPSfill
|
||||
{
|
||||
}
|
||||
|
||||
- (void) DPSsetlinewidth: (CGFloat)width
|
||||
{
|
||||
}
|
||||
|
||||
- (void) DPSsetdash: (const CGFloat *)pat : (NSInteger)size : (CGFloat)foffset
|
||||
{
|
||||
}
|
||||
|
||||
- (void) DPSimage: (NSAffineTransform *)matrix : (NSInteger)pixelsWide
|
||||
: (NSInteger)pixelsHigh : (NSInteger)bitsPerSample
|
||||
: (NSInteger)samplesPerPixel : (NSInteger)bitsPerPixel
|
||||
: (NSInteger)bytesPerRow : (BOOL)isPlanar
|
||||
: (BOOL)hasAlpha : (NSString *)colorSpaceName
|
||||
: (const unsigned char *const[5])data
|
||||
{
|
||||
}
|
||||
|
||||
- (void) DPSstroke
|
||||
{
|
||||
}
|
||||
|
||||
- (void) compositerect: (NSRect)aRect op: (NSCompositingOperation)op
|
||||
{
|
||||
}
|
||||
|
||||
- (void) compositeGState: (HeadlessGState *)source
|
||||
fromRect: (NSRect)srcRect
|
||||
toPoint: (NSPoint)destPoint
|
||||
op: (NSCompositingOperation)op
|
||||
fraction: (CGFloat)delta
|
||||
{
|
||||
}
|
||||
|
||||
@end
|
|
@ -1,115 +0,0 @@
|
|||
/*
|
||||
HeadlessServer.m
|
||||
|
||||
Copyright (C) 1998,2002,2023 Free Software Foundation, Inc.
|
||||
|
||||
Based on work by: Marcian Lytwyn <gnustep@advcsi.com> for Keysight
|
||||
Based on work by: Adam Fedor <fedor@gnu.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; see the file COPYING.LIB.
|
||||
If not, see <http://www.gnu.org/licenses/> or write to the
|
||||
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <AppKit/NSApplication.h>
|
||||
#include <Foundation/NSDebug.h>
|
||||
#include <Foundation/NSValue.h>
|
||||
|
||||
#include "headless/HeadlessServer.h"
|
||||
|
||||
/* Terminate cleanly if we get a signal to do so */
|
||||
static void
|
||||
terminate(int sig)
|
||||
{
|
||||
if (nil != NSApp)
|
||||
{
|
||||
[NSApp terminate: NSApp];
|
||||
}
|
||||
else
|
||||
{
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
@implementation HeadlessServer
|
||||
|
||||
/* Initialize AppKit backend */
|
||||
+ (void) initializeBackend
|
||||
{
|
||||
NSDebugLog(@"Initializing GNUstep headless backend.\n");
|
||||
[GSDisplayServer setDefaultServerClass: [HeadlessServer class]];
|
||||
signal(SIGTERM, terminate);
|
||||
signal(SIGINT, terminate);
|
||||
}
|
||||
|
||||
- (NSArray *)screenList
|
||||
{
|
||||
NSDebugLog(@"GNUstep headless - fetching screen list");
|
||||
NSMutableArray *screens = [NSMutableArray arrayWithCapacity: 1];
|
||||
[screens addObject: [NSNumber numberWithInt: 1]];
|
||||
|
||||
return screens;
|
||||
}
|
||||
|
||||
- (NSRect) boundsForScreen: (int)screen
|
||||
{
|
||||
return NSMakeRect(0, 0, 400, 400);
|
||||
}
|
||||
|
||||
- (NSWindowDepth) windowDepthForScreen: (int) screen_num
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
- (void) styleoffsets: (float *) l : (float *) r : (float *) t : (float *) b
|
||||
: (unsigned int) style
|
||||
{
|
||||
}
|
||||
|
||||
- (void) standardcursor: (int)style : (void **)cid
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
- (int) window: (NSRect)frame
|
||||
: (NSBackingStoreType)type
|
||||
: (unsigned int)style
|
||||
: (int)screen
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
- (void) setwindowlevel: (int)level : (int)win
|
||||
{
|
||||
}
|
||||
|
||||
- (void) setWindowdevice: (int)win forContext: (NSGraphicsContext *)ctxt
|
||||
{
|
||||
}
|
||||
|
||||
- (void) orderwindow: (int)op : (int)otherWin : (int)winNum
|
||||
{
|
||||
}
|
||||
|
||||
- (void) setinputfocus: (int)win
|
||||
{
|
||||
}
|
||||
|
||||
- (void) imagecursor: (NSPoint)hotp : (NSImage *)image : (void **)cid
|
||||
{
|
||||
}
|
||||
@end
|
53
Source/headlesslib/GNUmakefile
Normal file
53
Source/headlesslib/GNUmakefile
Normal file
|
@ -0,0 +1,53 @@
|
|||
# Copyright (C) 2004 Free Software Foundation, Inc.
|
||||
#
|
||||
# Author: Banlu Kemiyatorn <object at gmail dot com>
|
||||
#
|
||||
# This file is part of the GNUstep Backend.
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; see the file COPYING.LIB.
|
||||
# If not, see <http://www.gnu.org/licenses/> or write to the
|
||||
# Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
|
||||
PACKAGE_NAME = gnustep-back
|
||||
GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES=../../back.make
|
||||
include $(GNUSTEP_MAKEFILES)/common.make
|
||||
|
||||
include ../../config.make
|
||||
|
||||
SUBPROJECT_NAME=headlesslib
|
||||
|
||||
# The Objective-C source files to be compiled
|
||||
headlesslib_OBJC_FILES = \
|
||||
HeadlessSurface.m \
|
||||
HeadlessFontInfo.m \
|
||||
HeadlessGState.m \
|
||||
HeadlessContext.m \
|
||||
HeadlessFontEnumerator.m \
|
||||
HeadlessFaceInfo.m \
|
||||
|
||||
|
||||
|
||||
ifeq ($(BUILD_SERVER),xheadless)
|
||||
headlesslib_OBJC_FILES += HeadlessModernSurface.m
|
||||
endif
|
||||
|
||||
headlesslib_OBJC_FILES +=
|
||||
|
||||
-include GNUmakefile.preamble
|
||||
|
||||
include $(GNUSTEP_MAKEFILES)/subproject.make
|
||||
|
||||
-include GNUmakefile.postamble
|
||||
|
52
Source/headlesslib/GNUmakefile.preamble
Normal file
52
Source/headlesslib/GNUmakefile.preamble
Normal file
|
@ -0,0 +1,52 @@
|
|||
#
|
||||
# GNUmakefile.preamble
|
||||
#
|
||||
# Copyright (C) 2002 Free Software Foundation, Inc.
|
||||
#
|
||||
# Author: Adam Fedor <fedor@gnu.org>
|
||||
#
|
||||
# This file is part of the GNUstep Backend.
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; see the file COPYING.LIB.
|
||||
# If not, see <http://www.gnu.org/licenses/> or write to the
|
||||
# Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
|
||||
#
|
||||
# Flags dealing with compiling and linking
|
||||
#
|
||||
|
||||
# Additional flags to pass to the preprocessor
|
||||
ADDITIONAL_CPPFLAGS += -Wall $(CONFIG_SYSTEM_DEFS)
|
||||
|
||||
# Additional flags to pass to the Objective-C compiler
|
||||
#ADDITIONAL_OBJCFLAGS =
|
||||
|
||||
# Additional flags to pass to the C compiler
|
||||
#ADDITIONAL_CFLAGS =
|
||||
|
||||
# Additional include directories the compiler should search
|
||||
ADDITIONAL_INCLUDE_DIRS = -I../../Headers \
|
||||
-I../$(GNUSTEP_TARGET_DIR) $(GRAPHIC_CFLAGS) \
|
||||
|
||||
# Additional LDFLAGS to pass to the linker
|
||||
#ADDITIONAL_LDFLAGS =
|
||||
|
||||
# Additional library directories the linker should search
|
||||
#ADDITIONAL_LIB_DIRS =
|
||||
|
||||
#
|
||||
# Flags dealing with installing and uninstalling
|
||||
#
|
||||
|
192
Source/headlesslib/HeadlessContext.m
Normal file
192
Source/headlesslib/HeadlessContext.m
Normal file
|
@ -0,0 +1,192 @@
|
|||
/*
|
||||
HeadlessContext.m
|
||||
|
||||
Copyright (C) 2003, 2023 Free Software Foundation, Inc.
|
||||
|
||||
August 17, 2023
|
||||
Re-written by Gregory Casamento <greg.casamento@gmail.com>
|
||||
Based on work by Marcian Lytwyn <gnustep@advcsi.com>
|
||||
August 31, 2003
|
||||
Originally Written by Banlu Kemiyatorn <object at gmail dot com>
|
||||
|
||||
This file is part of GNUstep.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; see the file COPYING.LIB.
|
||||
If not, see <http://www.gnu.org/licenses/> or write to the
|
||||
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <AppKit/NSBitmapImageRep.h>
|
||||
#include <AppKit/NSGraphics.h>
|
||||
#include <AppKit/NSPrintInfo.h>
|
||||
#include <AppKit/NSPrintOperation.h>
|
||||
|
||||
#include "headlesslib/HeadlessGState.h"
|
||||
#include "headlesslib/HeadlessContext.h"
|
||||
#include "headlesslib/HeadlessSurface.h"
|
||||
#include "headlesslib/HeadlessFontInfo.h"
|
||||
#include "headlesslib/HeadlessFontEnumerator.h"
|
||||
#include "config.h"
|
||||
|
||||
#define CGSTATE ((HeadlessGState *)gstate)
|
||||
|
||||
|
||||
#define _CAIRO_GSTATE_CLASSNAME HeadlessGState
|
||||
#define _CAIRO_SURFACE_CLASSNAME HeadlessModernSurface
|
||||
#include "headlesslib/HeadlessModernSurface.h"
|
||||
|
||||
@implementation HeadlessContext
|
||||
|
||||
+ (void) initializeBackend
|
||||
{
|
||||
[NSGraphicsContext setDefaultContextClass: self];
|
||||
|
||||
[GSFontEnumerator setDefaultClass: [HeadlessFontEnumerator class]];
|
||||
[GSFontInfo setDefaultClass: [HeadlessFontInfo class]];
|
||||
}
|
||||
|
||||
+ (Class) GStateClass
|
||||
{
|
||||
return [_CAIRO_GSTATE_CLASSNAME class];
|
||||
}
|
||||
|
||||
+ (BOOL) handlesPS
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL) supportsDrawGState
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (id) initWithContextInfo: (NSDictionary *)info
|
||||
{
|
||||
self = [super initWithContextInfo:info];
|
||||
if (self)
|
||||
{
|
||||
[self setImageInterpolation:NSImageInterpolationDefault];
|
||||
}
|
||||
return(self);
|
||||
}
|
||||
|
||||
- (BOOL) isDrawingToScreen
|
||||
{
|
||||
HeadlessSurface *surface = nil;
|
||||
[CGSTATE GSCurrentSurface: &surface : NULL : NULL];
|
||||
return [surface isDrawingToScreen];
|
||||
}
|
||||
|
||||
- (void) flushGraphics
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/* Private backend methods */
|
||||
+ (void) handleExposeRect: (NSRect)rect forDriver: (void *)driver
|
||||
{
|
||||
}
|
||||
|
||||
#if BUILD_SERVER == SERVER_x11
|
||||
|
||||
#ifdef XSHM
|
||||
|
||||
+ (void) _gotShmCompletion: (Drawable)d
|
||||
{
|
||||
}
|
||||
|
||||
- (void) gotShmCompletion: (Drawable)d
|
||||
{
|
||||
}
|
||||
|
||||
#endif // XSHM
|
||||
|
||||
#endif // BUILD_SERVER = SERVER_x11
|
||||
|
||||
@end
|
||||
|
||||
@implementation HeadlessContext (Ops)
|
||||
|
||||
- (BOOL) isCompatibleBitmap: (NSBitmapImageRep*)bitmap
|
||||
{
|
||||
NSString *colorSpaceName;
|
||||
|
||||
if ([bitmap bitmapFormat] != 0)
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
if ([bitmap isPlanar])
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
if ([bitmap bitsPerSample] != 8)
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
colorSpaceName = [bitmap colorSpaceName];
|
||||
if (![colorSpaceName isEqualToString: NSDeviceRGBColorSpace] &&
|
||||
![colorSpaceName isEqualToString: NSCalibratedRGBColorSpace])
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
else
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
|
||||
- (void) GSCurrentDevice: (void **)device : (int *)x : (int *)y
|
||||
{
|
||||
HeadlessSurface *surface;
|
||||
|
||||
[CGSTATE GSCurrentSurface: &surface : x : y];
|
||||
if (device)
|
||||
{
|
||||
*device = surface->gsDevice;
|
||||
}
|
||||
}
|
||||
|
||||
- (void) GSSetDevice: (void *)device : (int)x : (int)y
|
||||
{
|
||||
HeadlessSurface *surface;
|
||||
|
||||
surface = [[_CAIRO_SURFACE_CLASSNAME alloc] initWithDevice: device];
|
||||
|
||||
[CGSTATE GSSetSurface: surface : x : y];
|
||||
[surface release];
|
||||
}
|
||||
|
||||
- (void) beginPrologueBBox: (NSRect)boundingBox
|
||||
creationDate: (NSString*)dateCreated
|
||||
createdBy: (NSString*)anApplication
|
||||
fonts: (NSString*)fontNames
|
||||
forWhom: (NSString*)user
|
||||
pages: (int)numPages
|
||||
title: (NSString*)aTitle
|
||||
{
|
||||
}
|
||||
|
||||
- (void) showPage
|
||||
{
|
||||
[CGSTATE showPage];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#undef _CAIRO_SURFACE_CLASSNAME
|
||||
#undef _CAIRO_GSTATE_CLASSNAME
|
|
@ -1,12 +1,16 @@
|
|||
/*
|
||||
HeadlessFaceInfo.m
|
||||
HwadlessFaceInfo.m
|
||||
|
||||
Copyright (C) 2003, 2023 Free Software Foundation, Inc.
|
||||
|
||||
Based on work by: Marcian Lytwyn <gnustep@advcsi.com> for Keysight
|
||||
Based on work by: Banlu Kemiyatorn <object at gmail dot com>
|
||||
Based on work by: Alex Malmberg
|
||||
Based on work by: Fred Kiefer <fredkiefer@gmx.de>
|
||||
August 17, 2023
|
||||
Re-written by Gregory Casamento <greg.casamento@gmail.com>
|
||||
Based on work Marcian Lytwyn <gnustep@advcsi.com>
|
||||
August 31, 2003
|
||||
Originally Written by Banlu Kemiyatorn <object at gmail dot com>
|
||||
Base on original code of Alex Malmberg
|
||||
Rewrite: Fred Kiefer <fredkiefer@gmx.de>
|
||||
Date: Jan 2006
|
||||
|
||||
This file is part of GNUstep.
|
||||
|
||||
|
@ -22,12 +26,12 @@
|
|||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; see the file COPYING.LIB.
|
||||
If not, see <http://www.gnu.org/licenses/> or write to the
|
||||
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
If not, see <http://www.gnu.org/licenses/> or write to the
|
||||
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "headless/HeadlessFaceInfo.h"
|
||||
#include "headlesslib/HeadlessFaceInfo.h"
|
||||
|
||||
@implementation HeadlessFaceInfo
|
||||
|
||||
|
@ -41,4 +45,4 @@
|
|||
return _fontFace;
|
||||
}
|
||||
|
||||
@end
|
||||
@end
|
|
@ -3,10 +3,16 @@
|
|||
|
||||
Copyright (C) 2003, 2023 Free Software Foundation, Inc.
|
||||
|
||||
Based on work by: Marcian Lytwyn <gnustep@advcsi.com> for Keysight
|
||||
Based on work by: Banlu Kemiyatorn <object at gmail dot com>
|
||||
Based on work by: Alex Malmberg
|
||||
Based on work by: Fred Kiefer <fredkiefer@gmx.de>
|
||||
August 17, 2023
|
||||
Re-written by Gregory Casamento <greg.casamento@gmail.com>
|
||||
Based on work by Marcian Lytwyn <gnustep@advcsi.com>
|
||||
August 31, 2003
|
||||
Written by Banlu Kemiyatorn <object at gmail dot com>
|
||||
Base on original code of Alex Malmberg
|
||||
Rewrite: Fred Kiefer <fredkiefer@gmx.de>
|
||||
Date: Jan 2006
|
||||
|
||||
This file is part of GNUstep.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -20,13 +26,16 @@
|
|||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; see the file COPYING.LIB.
|
||||
If not, see <http://www.gnu.org/licenses/> or write to the
|
||||
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
If not, see <http://www.gnu.org/licenses/> or write to the
|
||||
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "headless/HeadlessFontEnumerator.h"
|
||||
#include "headless/HeadlessFontInfo.h"
|
||||
#include "headlesslib/HeadlessFontEnumerator.h"
|
||||
#include "headlesslib/HeadlessFontInfo.h"
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wobjc-method-access"
|
||||
|
||||
@implementation HeadlessFontEnumerator
|
||||
|
||||
|
@ -44,4 +53,6 @@
|
|||
{
|
||||
}
|
||||
|
||||
@end
|
||||
@end
|
||||
|
||||
#pragma GCC diagnostic pop
|
|
@ -3,9 +3,14 @@
|
|||
|
||||
Copyright (C) 2003, 2023 Free Software Foundation, Inc.
|
||||
|
||||
Based on work by: Marcian Lytwyn <gnustep@advcsi.com> for Keysight
|
||||
Based on work by: Banlu Kemiyatorn <object at gmail dot com>
|
||||
Based on work by: Alex Malmberg
|
||||
August 17, 2023
|
||||
Re-wrtten by Gregory Casamento <greg.casamento@gmail.com>
|
||||
Based on work by Marcian Lytwyn <gnustep@advcsi.com>
|
||||
August 31, 2003
|
||||
Written by Banlu Kemiyatorn <object at gmail dot com>
|
||||
Base on original code of Alex Malmberg
|
||||
|
||||
This file is part of GNUstep.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -19,21 +24,28 @@
|
|||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; see the file COPYING.LIB.
|
||||
If not, see <http://www.gnu.org/licenses/> or write to the
|
||||
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
If not, see <http://www.gnu.org/licenses/> or write to the
|
||||
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "GNUstepBase/Unicode.h"
|
||||
#include <AppKit/NSAffineTransform.h>
|
||||
#include <AppKit/NSBezierPath.h>
|
||||
#include "headless/HeadlessFontInfo.h"
|
||||
#include "headless/HeadlessFontEnumerator.h"
|
||||
#include "headlesslib/HeadlessFontInfo.h"
|
||||
#include "headlesslib/HeadlessFontEnumerator.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
typedef void *cairo_t;
|
||||
|
||||
@implementation HeadlessFontInfo
|
||||
|
||||
- (BOOL) setupAttributes
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (id) initWithFontName: (NSString *)name
|
||||
matrix: (const CGFloat *)fmatrix
|
||||
screenFont: (BOOL)p_screenFont
|
||||
|
@ -42,13 +54,14 @@
|
|||
if (!self)
|
||||
return nil;
|
||||
|
||||
#ifndef _MSC_VER
|
||||
// Accessing instance variables across module boundaries is not supported by the Visual Studio
|
||||
// toolchain; this could be implemented using e.g. setFontName: and setMatrix: method on the
|
||||
// base case.
|
||||
fontName = [name copy];
|
||||
memcpy(matrix, fmatrix, sizeof(matrix));
|
||||
#endif
|
||||
|
||||
if (![self setupAttributes])
|
||||
{
|
||||
RELEASE(self);
|
||||
return nil;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
@ -60,7 +73,15 @@
|
|||
|
||||
- (BOOL) glyphIsEncoded: (NSGlyph)glyph
|
||||
{
|
||||
return NO;
|
||||
/* FIXME: There is no proper way to determine with the toy font API,
|
||||
whether a glyph is supported or not. We will just ignore ligatures
|
||||
and report all other glyph as existing.
|
||||
return !NSEqualSizes([self advancementForGlyph: glyph], NSZeroSize);
|
||||
*/
|
||||
if ((glyph >= 0xFB00) && (glyph <= 0xFB05))
|
||||
return NO;
|
||||
else
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (NSSize) advancementForGlyph: (NSGlyph)glyph
|
||||
|
@ -84,4 +105,10 @@
|
|||
{
|
||||
}
|
||||
|
||||
@end
|
||||
- (void) drawGlyphs: (const NSGlyph*)glyphs
|
||||
length: (int)length
|
||||
on: (cairo_t*)ct
|
||||
{
|
||||
}
|
||||
|
||||
@end
|
342
Source/headlesslib/HeadlessGState.m
Normal file
342
Source/headlesslib/HeadlessGState.m
Normal file
|
@ -0,0 +1,342 @@
|
|||
/*
|
||||
HeadlessGState.m
|
||||
|
||||
Copyright (C) 2003, 2023 Free Software Foundation, Inc.
|
||||
|
||||
August 17, 2023
|
||||
Re-wrtten by Gregory Casamento <greg.casamento@gmail.com>
|
||||
Based on work by Marcian Lytwyn <gnustep@advcsi.com>
|
||||
August 31, 2003
|
||||
Written by Banlu Kemiyatorn <object at gmail dot com>
|
||||
Rewrite: Fred Kiefer <fredkiefer@gmx.de>
|
||||
Date: Jan 2006
|
||||
|
||||
This file is part of GNUstep.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; see the file COPYING.LIB.
|
||||
If not, see <http://www.gnu.org/licenses/> or write to the
|
||||
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <AppKit/NSAffineTransform.h>
|
||||
#include <AppKit/NSBezierPath.h>
|
||||
#include <AppKit/NSColor.h>
|
||||
#include <AppKit/NSGradient.h>
|
||||
#include <AppKit/NSGraphics.h>
|
||||
#include "headlesslib/HeadlessGState.h"
|
||||
#include "headlesslib/HeadlessFontInfo.h"
|
||||
#include "headlesslib/HeadlessSurface.h"
|
||||
#include "headlesslib/HeadlessContext.h"
|
||||
#include <math.h>
|
||||
|
||||
|
||||
// Macro stolen from base/Header/Additions/GNUstepBase/GSObjRuntime.h
|
||||
#ifndef GS_MAX_OBJECTS_FROM_STACK
|
||||
/**
|
||||
* The number of objects to try to get from varargs into an array on
|
||||
* the stack ... if there are more than this, use the heap.
|
||||
* NB. This MUST be a multiple of 2
|
||||
*/
|
||||
#define GS_MAX_OBJECTS_FROM_STACK 128
|
||||
#endif
|
||||
|
||||
// Macros stolen from base/Source/GSPrivate.h
|
||||
/**
|
||||
* Macro to manage memory for chunks of code that need to work with
|
||||
* arrays of items. Use this to start the block of code using
|
||||
* the array and GS_ENDITEMBUF() to end it. The idea is to ensure that small
|
||||
* arrays are allocated on the stack (for speed), but large arrays are
|
||||
* allocated from the heap (to avoid stack overflow).
|
||||
*/
|
||||
#define GS_BEGINITEMBUF(P, S, T) { \
|
||||
T _ibuf[(S) <= GS_MAX_OBJECTS_FROM_STACK ? (S) : 0]; \
|
||||
T *_base = ((S) <= GS_MAX_OBJECTS_FROM_STACK) ? _ibuf \
|
||||
: (T*)NSZoneMalloc(NSDefaultMallocZone(), (S) * sizeof(T)); \
|
||||
T *(P) = _base;
|
||||
|
||||
/**
|
||||
* Macro to manage memory for chunks of code that need to work with
|
||||
* arrays of items. Use GS_BEGINITEMBUF() to start the block of code using
|
||||
* the array and this macro to end it.
|
||||
*/
|
||||
#define GS_ENDITEMBUF() \
|
||||
if (_base != _ibuf) \
|
||||
NSZoneFree(NSDefaultMallocZone(), _base); \
|
||||
}
|
||||
|
||||
@implementation HeadlessGState
|
||||
|
||||
+ (void) initialize
|
||||
{
|
||||
if (self == [HeadlessGState class])
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
RELEASE(_surface);
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (NSString*) description
|
||||
{
|
||||
NSMutableString *description = [[[super description] mutableCopy] autorelease];
|
||||
[description appendFormat: @" surface: %@",_surface];
|
||||
[description appendFormat: @" context: %p",_ct];
|
||||
return [[description copy] autorelease];
|
||||
}
|
||||
|
||||
- (id) copyWithZone: (NSZone *)zone
|
||||
{
|
||||
HeadlessGState *copy = (HeadlessGState *)[super copyWithZone: zone];
|
||||
return copy;
|
||||
}
|
||||
|
||||
- (void) GSCurrentSurface: (HeadlessSurface **)surface : (int *)x : (int *)y
|
||||
{
|
||||
if (x)
|
||||
*x = offset.x;
|
||||
if (y)
|
||||
*y = offset.y;
|
||||
if (surface)
|
||||
{
|
||||
*surface = _surface;
|
||||
}
|
||||
}
|
||||
|
||||
- (void) GSSetSurface: (HeadlessSurface *)surface : (int)x : (int)y
|
||||
{
|
||||
ASSIGN(_surface, surface);
|
||||
[self setOffset: NSMakePoint(x, y)];
|
||||
[self DPSinitgraphics];
|
||||
}
|
||||
|
||||
- (void) setOffset: (NSPoint)theOffset
|
||||
{
|
||||
[super setOffset: theOffset];
|
||||
}
|
||||
|
||||
- (void) showPage
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
* Color operations
|
||||
*/
|
||||
- (void) GSSetPatterColor: (NSImage*)image
|
||||
{
|
||||
// FIXME: Create a cairo surface from the image and set it as source.
|
||||
[super GSSetPatterColor: image];
|
||||
}
|
||||
|
||||
/*
|
||||
* Text operations
|
||||
*/
|
||||
|
||||
- (void) _setPoint
|
||||
{
|
||||
}
|
||||
|
||||
- (void) DPScharpath: (const char *)s : (int)b
|
||||
{
|
||||
}
|
||||
|
||||
- (void) DPSshow: (const char *)s
|
||||
{
|
||||
}
|
||||
|
||||
- (void) GSSetFont: (GSFontInfo *)fontref
|
||||
{
|
||||
[super GSSetFont: fontref];
|
||||
}
|
||||
|
||||
- (void) GSSetFontSize: (CGFloat)size
|
||||
{
|
||||
}
|
||||
|
||||
- (void) GSShowText: (const char *)string : (size_t)length
|
||||
{
|
||||
}
|
||||
|
||||
- (void) GSShowGlyphsWithAdvances: (const NSGlyph *)glyphs : (const NSSize *)advances : (size_t) length
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
* GState operations
|
||||
*/
|
||||
|
||||
- (void) DPSinitgraphics
|
||||
{
|
||||
[super DPSinitgraphics];
|
||||
}
|
||||
|
||||
- (void) DPScurrentflat: (CGFloat *)flatness
|
||||
{
|
||||
}
|
||||
|
||||
- (void) DPScurrentlinecap: (int *)linecap
|
||||
{
|
||||
}
|
||||
|
||||
- (void) DPScurrentlinejoin: (int *)linejoin
|
||||
{
|
||||
}
|
||||
|
||||
- (void) DPScurrentlinewidth: (CGFloat *)width
|
||||
{
|
||||
}
|
||||
|
||||
- (void) DPScurrentmiterlimit: (CGFloat *)limit
|
||||
{
|
||||
}
|
||||
|
||||
- (void) DPScurrentstrokeadjust: (int *)b
|
||||
{
|
||||
}
|
||||
|
||||
- (void) DPSsetdash: (const CGFloat *)pat : (NSInteger)size : (CGFloat)foffset
|
||||
{
|
||||
}
|
||||
|
||||
- (void) DPSsetflat: (CGFloat)flatness
|
||||
{
|
||||
[super DPSsetflat: flatness];
|
||||
}
|
||||
|
||||
- (void) DPSsetlinecap: (int)linecap
|
||||
{
|
||||
}
|
||||
|
||||
- (void) DPSsetlinejoin: (int)linejoin
|
||||
{
|
||||
}
|
||||
|
||||
- (void) DPSsetlinewidth: (CGFloat)width
|
||||
{
|
||||
}
|
||||
|
||||
- (void) DPSsetmiterlimit: (CGFloat)limit
|
||||
{
|
||||
}
|
||||
|
||||
- (void) DPSsetstrokeadjust: (int)b
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
* Path operations
|
||||
*/
|
||||
|
||||
- (void) _setPath
|
||||
{
|
||||
}
|
||||
|
||||
- (void) DPSclip
|
||||
{
|
||||
}
|
||||
|
||||
- (void) DPSeoclip
|
||||
{
|
||||
}
|
||||
|
||||
- (void) DPSeofill
|
||||
{
|
||||
}
|
||||
|
||||
- (void) DPSfill
|
||||
{
|
||||
}
|
||||
|
||||
- (void) DPSinitclip
|
||||
{
|
||||
}
|
||||
|
||||
- (void) DPSstroke
|
||||
{
|
||||
}
|
||||
|
||||
- (NSDictionary *) GSReadRect: (NSRect)r
|
||||
{
|
||||
return [NSDictionary dictionary];
|
||||
}
|
||||
|
||||
- (void) DPSimage: (NSAffineTransform *)matrix : (NSInteger)pixelsWide
|
||||
: (NSInteger)pixelsHigh : (NSInteger)bitsPerSample
|
||||
: (NSInteger)samplesPerPixel : (NSInteger)bitsPerPixel
|
||||
: (NSInteger)bytesPerRow : (BOOL)isPlanar
|
||||
: (BOOL)hasAlpha : (NSString *)colorSpaceName
|
||||
: (const unsigned char *const[5])data
|
||||
{
|
||||
}
|
||||
|
||||
- (void) compositerect: (NSRect)aRect op: (NSCompositingOperation)op
|
||||
{
|
||||
}
|
||||
|
||||
- (void) compositeGState: (HeadlessGState *)source
|
||||
fromRect: (NSRect)srcRect
|
||||
toPoint: (NSPoint)destPoint
|
||||
op: (NSCompositingOperation)op
|
||||
fraction: (CGFloat)delta
|
||||
{
|
||||
}
|
||||
|
||||
/** Unlike -compositeGState, -drawGSstate fully respects the AppKit CTM but
|
||||
doesn't support to use the receiver cairo target as the source. */
|
||||
- (void) drawGState: (HeadlessGState *)source
|
||||
fromRect: (NSRect)aRect
|
||||
toPoint: (NSPoint)aPoint
|
||||
op: (NSCompositingOperation)op
|
||||
fraction: (CGFloat)delta
|
||||
{
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation HeadlessGState (PatternColor)
|
||||
|
||||
- (void *) saveClip
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
- (void) restoreClip: (void *)savedClip
|
||||
{
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation HeadlessGState (NSGradient)
|
||||
|
||||
- (void) drawGradient: (NSGradient*)gradient
|
||||
fromCenter: (NSPoint)startCenter
|
||||
radius: (CGFloat)startRadius
|
||||
toCenter: (NSPoint)endCenter
|
||||
radius: (CGFloat)endRadius
|
||||
options: (NSUInteger)options
|
||||
{
|
||||
}
|
||||
|
||||
- (void) drawGradient: (NSGradient*)gradient
|
||||
fromPoint: (NSPoint)startPoint
|
||||
toPoint: (NSPoint)endPoint
|
||||
options: (NSUInteger)options
|
||||
{
|
||||
}
|
||||
|
||||
@end
|
55
Source/headlesslib/HeadlessModernSurface.m
Normal file
55
Source/headlesslib/HeadlessModernSurface.m
Normal file
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
Copyright (C) 2004, 2023 Free Software Foundation, Inc.
|
||||
|
||||
Re-writen by Gregory Casamento <greg.casamento@gmail.com>
|
||||
Based on work by Marcian Lytwyn <gnustep@advcsi.com>
|
||||
Based on Author: Eric Wasylishen <ewasylishen@gmail.com>
|
||||
|
||||
This file is part of GNUstep.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; see the file COPYING.LIB.
|
||||
If not, see <http://www.gnu.org/licenses/> or write to the
|
||||
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "xheadless/HeadlessServer.h"
|
||||
#include "xheadless/HeadlessServerWindow.h"
|
||||
#include "headlesslib/HeadlessModernSurface.h"
|
||||
|
||||
#define GSWINDEVICE ((gswindow_device_t *)gsDevice)
|
||||
|
||||
@implementation HeadlessModernSurface
|
||||
|
||||
- (id) initWithDevice: (void *)device
|
||||
{
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (NSSize) size
|
||||
{
|
||||
return GSWINDEVICE->xframe.size;
|
||||
}
|
||||
|
||||
- (void) handleExposeRect: (NSRect)rect
|
||||
{
|
||||
}
|
||||
|
||||
@end
|
79
Source/headlesslib/HeadlessSurface.m
Normal file
79
Source/headlesslib/HeadlessSurface.m
Normal file
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
Copyright (C) 2004, 2023 Free Software Foundation, Inc.
|
||||
|
||||
Re-writen by Gregory Casamento <greg.casamento@gmail.com>
|
||||
Based on work by Marcian Lytwyn <gnustep@advcsi.com>
|
||||
Based on work by Author: Banlu Kemiyatorn <object at gmail dot com>
|
||||
|
||||
This file is part of GNUstep.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; see the file COPYING.LIB.
|
||||
If not, see <http://www.gnu.org/licenses/> or write to the
|
||||
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "headlesslib/HeadlessSurface.h"
|
||||
|
||||
@implementation HeadlessSurface
|
||||
|
||||
- (id) initWithDevice: (void *) device
|
||||
{
|
||||
/* TODO FIXME make a more abstract struct for the device */
|
||||
[self subclassResponsibility:_cmd];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (NSString *) description
|
||||
{
|
||||
return [NSString stringWithFormat:@"<%@ %p xr:%p>", [self class], self, _surface];
|
||||
}
|
||||
|
||||
-(NSSize) size
|
||||
{
|
||||
[self subclassResponsibility:_cmd];
|
||||
return NSMakeSize(0, 0);
|
||||
}
|
||||
|
||||
- (void) setSize: (NSSize)newSize
|
||||
{
|
||||
[self subclassResponsibility:_cmd];
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wmismatched-return-types"
|
||||
|
||||
- (cairo_surface_t *) surface
|
||||
{
|
||||
return _surface;
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
- (void) handleExposeRect: (NSRect)rect
|
||||
{
|
||||
}
|
||||
|
||||
- (BOOL) isDrawingToScreen
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
@end
|
|
@ -38,8 +38,6 @@
|
|||
#include <linux/input.h>
|
||||
#include "wayland-cursor.h"
|
||||
|
||||
extern void wl_cursor_destroy(struct wl_cursor *cursor);
|
||||
|
||||
// XXX should this be configurable by the user?
|
||||
#define DOUBLECLICK_DELAY 300
|
||||
#define DOUBLECLICK_MOVE_THREASHOLD 3
|
||||
|
@ -854,4 +852,4 @@ WaylandServer (Cursor)
|
|||
wlconfig->mouse_scroll_multiplier = 1.0f;
|
||||
}
|
||||
}
|
||||
@end
|
||||
@end
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include <linux/input.h>
|
||||
#include <AppKit/NSText.h>
|
||||
#include <sys/mman.h>
|
||||
#include <unistd.h>
|
||||
|
||||
static void
|
||||
keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard,
|
||||
|
|
|
@ -28,11 +28,10 @@
|
|||
#include "wayland/WaylandServer.h"
|
||||
#include <AppKit/NSEvent.h>
|
||||
#include <AppKit/NSApplication.h>
|
||||
#include <AppKit/NSGraphics.h>
|
||||
|
||||
static void
|
||||
xdg_surface_on_configure(void *data, struct xdg_surface *xdg_surface,
|
||||
uint32_t serial)
|
||||
uint32_t serial)
|
||||
{
|
||||
struct window *window = data;
|
||||
|
||||
|
@ -44,6 +43,7 @@ xdg_surface_on_configure(void *data, struct xdg_surface *xdg_surface,
|
|||
free(window);
|
||||
return;
|
||||
}
|
||||
WaylandConfig *wlconfig = window->wlconfig;
|
||||
|
||||
NSEvent *ev = nil;
|
||||
NSWindow *nswindow = GSWindowWithNumber(window->window_id);
|
||||
|
@ -57,22 +57,22 @@ xdg_surface_on_configure(void *data, struct xdg_surface *xdg_surface,
|
|||
if (window->buffer_needs_attach)
|
||||
{
|
||||
[window->instance flushwindowrect:NSMakeRect(window->pos_x, window->pos_y,
|
||||
window->width, window->height)
|
||||
:window->window_id];
|
||||
window->width, window->height
|
||||
):window->window_id];
|
||||
}
|
||||
|
||||
if (window->wlconfig->pointer.focus
|
||||
&& window->wlconfig->pointer.focus->window_id == window->window_id)
|
||||
if (wlconfig->pointer.focus
|
||||
&& wlconfig->pointer.focus->window_id == window->window_id)
|
||||
{
|
||||
ev = [NSEvent otherEventWithType:NSAppKitDefined
|
||||
location:NSZeroPoint
|
||||
modifierFlags:0
|
||||
timestamp:0
|
||||
windowNumber:(int) window->window_id
|
||||
context:GSCurrentContext()
|
||||
subtype:GSAppKitWindowFocusIn
|
||||
data1:0
|
||||
data2:0];
|
||||
location:NSZeroPoint
|
||||
modifierFlags:0
|
||||
timestamp:0
|
||||
windowNumber:(int) window->window_id
|
||||
context:GSCurrentContext()
|
||||
subtype:GSAppKitWindowFocusIn
|
||||
data1:0
|
||||
data2:0];
|
||||
|
||||
[nswindow sendEvent:ev];
|
||||
}
|
||||
|
@ -80,14 +80,15 @@ xdg_surface_on_configure(void *data, struct xdg_surface *xdg_surface,
|
|||
|
||||
static void
|
||||
xdg_toplevel_configure(void *data, struct xdg_toplevel *xdg_toplevel,
|
||||
int32_t width, int32_t height, struct wl_array *states)
|
||||
int32_t width, int32_t height, struct wl_array *states)
|
||||
{
|
||||
struct window *window = data;
|
||||
WaylandConfig *wlconfig = window->wlconfig;
|
||||
|
||||
NSDebugLog(@"[%d] xdg_toplevel_configure %dx%d", window->window_id, width,
|
||||
height);
|
||||
NSDebugLog(@"[%d] xdg_toplevel_configure %ldx%ld", window->window_id, width,
|
||||
height);
|
||||
|
||||
// The compositor can send 0x0
|
||||
// the compositor can send 0.0x0.0
|
||||
if (width == 0 || height == 0)
|
||||
{
|
||||
return;
|
||||
|
@ -98,43 +99,45 @@ xdg_toplevel_configure(void *data, struct xdg_toplevel *xdg_toplevel,
|
|||
window->height = height;
|
||||
|
||||
xdg_surface_set_window_geometry(window->xdg_surface, 0, 0, window->width,
|
||||
window->height);
|
||||
window->height);
|
||||
|
||||
NSEvent *ev = [NSEvent otherEventWithType:NSAppKitDefined
|
||||
location:NSMakePoint(0.0, 0.0)
|
||||
modifierFlags:0
|
||||
timestamp:0
|
||||
windowNumber:window->window_id
|
||||
context:GSCurrentContext()
|
||||
subtype:GSAppKitWindowResized
|
||||
data1:window->width
|
||||
data2:window->height];
|
||||
location:NSMakePoint(0.0, 0.0)
|
||||
modifierFlags:0
|
||||
timestamp:0
|
||||
windowNumber:window->window_id
|
||||
context:GSCurrentContext()
|
||||
subtype:GSAppKitWindowResized
|
||||
data1:window->width
|
||||
data2:window->height];
|
||||
[(GSWindowWithNumber(window->window_id)) sendEvent:ev];
|
||||
}
|
||||
NSDebugLog(@"[%d] notify resize from backend=%dx%d", window->window_id,
|
||||
width, height);
|
||||
NSDebugLog(@"[%d] notify resize from backend=%ldx%ld", window->window_id,
|
||||
width, height);
|
||||
}
|
||||
|
||||
static void
|
||||
xdg_toplevel_close_handler(void *data, struct xdg_toplevel *xdg_toplevel)
|
||||
xdg_toplevel_close_handler(void *data, struct zxdg_toplevel_v6 *xdg_toplevel)
|
||||
{
|
||||
NSDebugLog(@"xdg_toplevel_close_handler");
|
||||
}
|
||||
|
||||
static void
|
||||
xdg_popup_configure(void *data, struct xdg_popup *xdg_popup, int32_t x,
|
||||
int32_t y, int32_t width, int32_t height)
|
||||
int32_t y, int32_t width, int32_t height)
|
||||
{
|
||||
struct window *window = data;
|
||||
WaylandConfig *wlconfig = window->wlconfig;
|
||||
|
||||
NSDebugLog(@"[%d] xdg_popup_configure [%d,%d %dx%d]", window->window_id, x, y,
|
||||
width, height);
|
||||
width, height);
|
||||
}
|
||||
|
||||
static void
|
||||
xdg_popup_done(void *data, struct xdg_popup *xdg_popup)
|
||||
{
|
||||
struct window *window = data;
|
||||
WaylandConfig *wlconfig = window->wlconfig;
|
||||
window->terminated = YES;
|
||||
xdg_popup_destroy(xdg_popup);
|
||||
wl_surface_destroy(window->surface);
|
||||
|
@ -142,7 +145,7 @@ xdg_popup_done(void *data, struct xdg_popup *xdg_popup)
|
|||
|
||||
static void
|
||||
wm_base_handle_ping(void *data, struct xdg_wm_base *xdg_wm_base,
|
||||
uint32_t serial)
|
||||
uint32_t serial)
|
||||
{
|
||||
NSDebugLog(@"wm_base_handle_ping");
|
||||
xdg_wm_base_pong(xdg_wm_base, serial);
|
||||
|
@ -164,4 +167,4 @@ const struct xdg_popup_listener xdg_popup_listener = {
|
|||
const struct xdg_toplevel_listener xdg_toplevel_listener = {
|
||||
.configure = xdg_toplevel_configure,
|
||||
.close = xdg_toplevel_close_handler,
|
||||
};
|
||||
};
|
||||
|
|
|
@ -781,7 +781,7 @@ WaylandServer (SurfaceRoles)
|
|||
break;
|
||||
case NSPopUpMenuWindowLevel:
|
||||
NSDebugLog(@"[%d] NSPopUpMenuWindowLevel", win);
|
||||
[self createPopup:window];
|
||||
[self createPopup:win];
|
||||
break;
|
||||
case NSScreenSaverWindowLevel:
|
||||
NSDebugLog(@"[%d] NSScreenSaverWindowLevel", win);
|
||||
|
@ -1099,4 +1099,4 @@ WaylandServer (SurfaceRoles)
|
|||
wl_display_flush(window->wlconfig->display);
|
||||
}
|
||||
|
||||
@end
|
||||
@end
|
||||
|
|
|
@ -63,18 +63,6 @@
|
|||
|
||||
#include <math.h>
|
||||
|
||||
// The Windows SDK declares BOOL as an int. Objective C defines BOOl as a char.
|
||||
// Those two types clash. MinGW's implementation of the Windows SDK uses the WINBOOL
|
||||
// type to avoid this clash. When compiling natively on Windows, we need to manually
|
||||
// define WINBOOL.
|
||||
// MinGW will define _DEF_WINBOOL_ if it has defined WINBOOL so we can use the same trick
|
||||
// here.
|
||||
// See https://github.com/mingw-w64/mingw-w64/blob/master/mingw-w64-headers/include/ntdef.h#L355
|
||||
#ifndef _DEF_WINBOOL_
|
||||
#define _DEF_WINBOOL_
|
||||
typedef int WINBOOL;
|
||||
#endif
|
||||
|
||||
// To update the cursor..
|
||||
static BOOL update_cursor = NO;
|
||||
static BOOL should_handle_cursor = NO;
|
||||
|
|
|
@ -33,18 +33,6 @@
|
|||
#include "win32/WIN32Server.h"
|
||||
#include "win32/WIN32Geometry.h"
|
||||
|
||||
// The Windows SDK declares BOOL as an int. Objective C defines BOOl as a char.
|
||||
// Those two types clash. MinGW's implementation of the Windows SDK uses the WINBOOL
|
||||
// type to avoid this clash. When compiling natively on Windows, we need to manually
|
||||
// define WINBOOL.
|
||||
// MinGW will define _DEF_WINBOOL_ if it has defined WINBOOL so we can use the same trick
|
||||
// here.
|
||||
// See https://github.com/mingw-w64/mingw-w64/blob/master/mingw-w64-headers/include/ntdef.h#L355
|
||||
#ifndef _DEF_WINBOOL_
|
||||
#define _DEF_WINBOOL_
|
||||
typedef int WINBOOL;
|
||||
#endif
|
||||
|
||||
static void
|
||||
invalidateWindow(WIN32Server *svr, HWND hwnd, RECT rect)
|
||||
{
|
||||
|
|
|
@ -453,14 +453,9 @@ NSLog(@"No glyph for U%d", c);
|
|||
logfont.lfItalic = 1;
|
||||
|
||||
logfont.lfQuality = DEFAULT_QUALITY;
|
||||
|
||||
if (familyName)
|
||||
{
|
||||
wcsncpy(logfont.lfFaceName,
|
||||
(const unichar*)[familyName cStringUsingEncoding: NSUnicodeStringEncoding],
|
||||
LF_FACESIZE);
|
||||
}
|
||||
|
||||
wcsncpy(logfont.lfFaceName,
|
||||
(const unichar*)[familyName cStringUsingEncoding: NSUnicodeStringEncoding],
|
||||
LF_FACESIZE);
|
||||
hFont = CreateFontIndirectW(&logfont);
|
||||
if (!hFont)
|
||||
{
|
||||
|
|
|
@ -803,7 +803,6 @@ _get_next_prop_new_event(Display *display, XEvent *event, char *arg)
|
|||
XEvent xEvent;
|
||||
unsigned long *extents;
|
||||
Offsets *o = generic.offsets + (style & 15);
|
||||
int windowIdent;
|
||||
int repp = 0;
|
||||
int repx = 0;
|
||||
int repy = 0;
|
||||
|
@ -1132,11 +1131,6 @@ _get_next_prop_new_event(Display *display, XEvent *event, char *arg)
|
|||
}
|
||||
}
|
||||
|
||||
/* Calling termwindow should cause the window to be destroyed,
|
||||
* so we need to take a copy of the window identifier to check
|
||||
* for events left in the queue about that window.
|
||||
*/
|
||||
windowIdent = window->ident;
|
||||
[self termwindow: window->number];
|
||||
XSync(dpy, False);
|
||||
while (XPending(dpy) > 0)
|
||||
|
@ -1144,7 +1138,7 @@ _get_next_prop_new_event(Display *display, XEvent *event, char *arg)
|
|||
XNextEvent(dpy, &xEvent);
|
||||
NSDebugLLog(@"Offset", @"Destroying ... event %d window %lu\n",
|
||||
xEvent.type, xEvent.xany.window);
|
||||
if (xEvent.xany.window != windowIdent)
|
||||
if (xEvent.xany.window != window->ident)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -151,18 +151,12 @@
|
|||
{
|
||||
/* Always returns a Latin-1 string according to the manpage */
|
||||
count = XLookupString (event, buf, BUF_LEN, &keysym, NULL);
|
||||
if (count == 1)
|
||||
if (count)
|
||||
{
|
||||
keys = [[[NSString alloc] initWithBytes: buf
|
||||
length: count
|
||||
encoding: NSISOLatin1StringEncoding] autorelease];
|
||||
}
|
||||
else if (count > 1) // manpage lies and we suppose UTF-8
|
||||
{
|
||||
keys = [[[NSString alloc] initWithBytes: buf
|
||||
length: count
|
||||
encoding: NSUTF8StringEncoding] autorelease];
|
||||
}
|
||||
|
||||
if (keysymptr)
|
||||
*keysymptr = keysym;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Main makefile for GNUstep Headless Backend
|
||||
# Main makefile for GNUstep Backend x11
|
||||
#
|
||||
# Copyright (C) 2002 Free Software Foundation, Inc.
|
||||
#
|
||||
|
@ -30,19 +30,17 @@ include $(GNUSTEP_MAKEFILES)/common.make
|
|||
include ../../config.make
|
||||
|
||||
# The library to be compiled, as a library or as a bundle
|
||||
SUBPROJECT_NAME=headless
|
||||
SUBPROJECT_NAME=xheadless
|
||||
|
||||
# The Objective-C source files to be compiled
|
||||
headless_OBJC_FILES = \
|
||||
HeadlessContext.m \
|
||||
xheadless_OBJC_FILES = \
|
||||
HeadlessServer.m \
|
||||
HeadlessFontInfo.m \
|
||||
HeadlessFontEnumerator.m \
|
||||
HeadlessFaceInfo.m \
|
||||
HeadlessGState.m
|
||||
HeadlessServerEvent.m \
|
||||
HeadlessServerWindow.m \
|
||||
|
||||
-include GNUmakefile.preamble
|
||||
|
||||
include $(GNUSTEP_MAKEFILES)/subproject.make
|
||||
|
||||
-include GNUmakefile.postamble
|
||||
-include GNUmakefile.postamble
|
||||
|
|
@ -49,3 +49,5 @@ ADDITIONAL_LIB_DIRS =
|
|||
#
|
||||
# Flags dealing with installing and uninstalling
|
||||
#
|
||||
|
||||
|
385
Source/xheadless/HeadlessServer.m
Normal file
385
Source/xheadless/HeadlessServer.m
Normal file
|
@ -0,0 +1,385 @@
|
|||
/* -*- mode:ObjC -*-
|
||||
HeadlessServer - X11 Server Class
|
||||
|
||||
Copyright (C) 1998,2002,2023 Free Software Foundation, Inc.
|
||||
|
||||
Re-written by: Gregory John Casamento <greg.casamento@gmail.com>
|
||||
Based on work by: Marcian Lytwyn <gnustep@advcsi.com> for Keysight
|
||||
Based on work Written by: Adam Fedor <fedor@gnu.org>
|
||||
Date: Mar 2002, Aug 2023
|
||||
|
||||
This file is part of the GNU Objective C User Interface Library.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; see the file COPYING.LIB.
|
||||
If not, see <http://www.gnu.org/licenses/> or write to the
|
||||
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <AppKit/AppKitExceptions.h>
|
||||
#include <AppKit/NSApplication.h>
|
||||
#include <AppKit/NSView.h>
|
||||
#include <AppKit/NSWindow.h>
|
||||
#include <Foundation/NSException.h>
|
||||
#include <Foundation/NSArray.h>
|
||||
#include <Foundation/NSConnection.h>
|
||||
#include <Foundation/NSDictionary.h>
|
||||
#include <Foundation/NSData.h>
|
||||
#include <Foundation/NSRunLoop.h>
|
||||
#include <Foundation/NSValue.h>
|
||||
#include <Foundation/NSString.h>
|
||||
#include <Foundation/NSUserDefaults.h>
|
||||
#include <Foundation/NSDebug.h>
|
||||
|
||||
#include <signal.h>
|
||||
/* Terminate cleanly if we get a signal to do so */
|
||||
static void
|
||||
terminate(int sig)
|
||||
{
|
||||
if (nil != NSApp)
|
||||
{
|
||||
[NSApp terminate: NSApp];
|
||||
}
|
||||
else
|
||||
{
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
#include "xheadless/HeadlessServer.h"
|
||||
#include "xheadless/HeadlessInputServer.h"
|
||||
|
||||
extern int XGErrorHandler(Display *display, XErrorEvent *err);
|
||||
|
||||
@interface HeadlessServer (Window)
|
||||
- (void) _setupRootWindow;
|
||||
@end
|
||||
|
||||
@interface HeadlessServer (Private)
|
||||
- (void) setupRunLoopInputSourcesForMode: (NSString*)mode;
|
||||
@end
|
||||
|
||||
@interface HeadlessScreenContext : NSObject
|
||||
{
|
||||
RContext *rcontext;
|
||||
XGDrawMechanism drawMechanism;
|
||||
}
|
||||
|
||||
- (instancetype) initForDisplay: (Display *)dpy screen: (int)screen_number;
|
||||
- (XGDrawMechanism) drawMechanism;
|
||||
- (RContext *) context;
|
||||
@end
|
||||
|
||||
@implementation HeadlessScreenContext
|
||||
|
||||
- (RContextAttributes *) _getXDefaults
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
- initForDisplay: (Display *)dpy screen: (int)screen_number
|
||||
{
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (XGDrawMechanism) drawMechanism
|
||||
{
|
||||
return drawMechanism;
|
||||
}
|
||||
|
||||
- (RContext *) context
|
||||
{
|
||||
return rcontext;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
/**
|
||||
<unit>
|
||||
<heading>HeadlessServer</heading>
|
||||
|
||||
<p> HeadlessServer is a concrete subclass of GSDisplayServer that handles
|
||||
events and interactions for the headless server. The purpose of the headless
|
||||
server is to allow apps which would normally have an interface under X to
|
||||
show no visible windows. This is useful for testing or for running applications
|
||||
on machines that have no display available, but where the application needs to run.
|
||||
This also can be used in continuous integration to test an application in the
|
||||
background.
|
||||
</unit>
|
||||
*/
|
||||
|
||||
@implementation HeadlessServer
|
||||
|
||||
/* Initialize AppKit backend */
|
||||
+ (void) initializeBackend
|
||||
{
|
||||
NSDebugLog(@"Initializing GNUstep x11 backend.\n");
|
||||
[GSDisplayServer setDefaultServerClass: [HeadlessServer class]];
|
||||
signal(SIGTERM, terminate);
|
||||
signal(SIGINT, terminate);
|
||||
}
|
||||
|
||||
/**
|
||||
Returns a pointer to the current X-Windows display variable for
|
||||
the current context.
|
||||
*/
|
||||
+ (Display*) currentXDisplay
|
||||
{
|
||||
return [(HeadlessServer*)GSCurrentServer() xDisplay];
|
||||
}
|
||||
|
||||
- (id) _initXContext
|
||||
{
|
||||
int screen_number = 0, display_number = 0;
|
||||
NSString *display_name;
|
||||
|
||||
display_name = [server_info objectForKey: GSDisplayName];
|
||||
if (display_name == nil)
|
||||
{
|
||||
NSString *host = [[NSUserDefaults standardUserDefaults]
|
||||
stringForKey: @"NSHost"];
|
||||
NSString *dn = [server_info objectForKey: GSDisplayNumber];
|
||||
NSString *sn = [server_info objectForKey: GSScreenNumber];
|
||||
|
||||
if (dn || sn)
|
||||
{
|
||||
if (dn == NULL)
|
||||
dn = @"0";
|
||||
if (sn == NULL)
|
||||
sn = @"0";
|
||||
if (host == nil)
|
||||
host = @"";
|
||||
display_name = [NSString stringWithFormat: @"%@:%@.%@", host, dn,sn];
|
||||
}
|
||||
else if ((host != nil) && ([host isEqual: @""] == NO))
|
||||
{
|
||||
/**
|
||||
* If the NSHost default told us to display somewhere, we need
|
||||
* to generate a display name for X from the host name and the
|
||||
* default display and screen numbers (zero).
|
||||
*/
|
||||
display_name = [NSString stringWithFormat: @"%@:0.0", host];
|
||||
}
|
||||
}
|
||||
|
||||
dpy = malloc(sizeof(Display)); //XOpenDisplay(NULL);
|
||||
|
||||
[server_info setObject: display_name forKey: GSDisplayName];
|
||||
[server_info setObject: [NSNumber numberWithInt: display_number]
|
||||
forKey: GSDisplayNumber];
|
||||
[server_info setObject: [NSNumber numberWithInt: screen_number]
|
||||
forKey: GSScreenNumber];
|
||||
|
||||
/* Setup screen*/
|
||||
if (screenList == NULL)
|
||||
screenList = NSCreateMapTable(NSIntMapKeyCallBacks,
|
||||
NSObjectMapValueCallBacks, 20);
|
||||
|
||||
defScreen = screen_number;
|
||||
|
||||
[self _setupRootWindow];
|
||||
inputServer = nil;
|
||||
return self;
|
||||
}
|
||||
|
||||
/**
|
||||
Opens the X display (using a helper method) and sets up basic
|
||||
display mechanisms, such as visuals and colormaps.
|
||||
*/
|
||||
- (id) initWithAttributes: (NSDictionary *)info
|
||||
{
|
||||
[super initWithAttributes: info];
|
||||
[self _initXContext];
|
||||
|
||||
[self setupRunLoopInputSourcesForMode: NSDefaultRunLoopMode];
|
||||
[self setupRunLoopInputSourcesForMode: NSConnectionReplyMode];
|
||||
[self setupRunLoopInputSourcesForMode: NSModalPanelRunLoopMode];
|
||||
[self setupRunLoopInputSourcesForMode: NSEventTrackingRunLoopMode];
|
||||
return self;
|
||||
}
|
||||
|
||||
/**
|
||||
Closes all X resources, the X display and dealloc other ivars.
|
||||
*/
|
||||
- (void) dealloc
|
||||
{
|
||||
NSDebugLog(@"Destroying X11 Server");
|
||||
DESTROY(inputServer);
|
||||
[self _destroyServerWindows];
|
||||
NSFreeMapTable(screenList);
|
||||
//XCloseDisplay(dpy);
|
||||
free(dpy);
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
/**
|
||||
Returns a pointer to the X windows display variable
|
||||
*/
|
||||
- (Display *) xDisplay
|
||||
{
|
||||
return dpy;
|
||||
}
|
||||
|
||||
- (HeadlessScreenContext *) _screenContextForScreen: (int)screen_number
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
/**
|
||||
Returns a pointer to a structure which describes aspects of the
|
||||
X windows display
|
||||
*/
|
||||
- (void *) xrContextForScreen: (int)screen_number
|
||||
{
|
||||
return [[self _screenContextForScreen: screen_number] context];
|
||||
}
|
||||
|
||||
- (Visual *) visualForScreen: (int)screen_number
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
- (int) depthForScreen: (int)screen_number
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the XGDrawMechanism, which roughly describes the depth of
|
||||
the screen and how pixels should be drawn to the screen for maximum
|
||||
speed.
|
||||
*/
|
||||
- (XGDrawMechanism) drawMechanismForScreen: (int)screen_number
|
||||
{
|
||||
return [[self _screenContextForScreen: screen_number] drawMechanism];
|
||||
}
|
||||
|
||||
/**
|
||||
* Used by the art backend to determine the drawing mechanism.
|
||||
*/
|
||||
- (void) getForScreen: (int)screen_number pixelFormat: (int *)bpp_number
|
||||
masks: (int *)red_mask : (int *)green_mask : (int *)blue_mask
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the root window of the display
|
||||
*/
|
||||
- (Window) xDisplayRootWindowForScreen: (int)screen_number;
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the closest color in the current colormap to the indicated
|
||||
X color
|
||||
*/
|
||||
- (XColor) xColorFromColor: (XColor)color forScreen: (int)screen_number
|
||||
{
|
||||
return color;
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the application root window, which is used for many things
|
||||
such as window hints
|
||||
*/
|
||||
- (Window) xAppRootWindow
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Wait for all contexts to finish processing. Only used with XDPS graphics.
|
||||
*/
|
||||
+ (void) waitAllContexts
|
||||
{
|
||||
if ([[GSCurrentContext() class]
|
||||
respondsToSelector: @selector(waitAllContexts)])
|
||||
[[GSCurrentContext() class] waitAllContexts];
|
||||
}
|
||||
|
||||
- (void) beep
|
||||
{
|
||||
}
|
||||
|
||||
- glContextClass
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
- glPixelFormatClass
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@implementation HeadlessServer (InputMethod)
|
||||
- (NSString *) inputMethodStyle
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (NSString *) fontSize: (int *)size
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (BOOL) clientWindowRect: (NSRect *)rect
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL) statusArea: (NSRect *)rect
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL) preeditArea: (NSRect *)rect
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL) preeditSpot: (NSPoint *)p
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL) setStatusArea: (NSRect *)rect
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL) setPreeditArea: (NSRect *)rect
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL) setPreeditSpot: (NSPoint *)p
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
@end // XGServer (InputMethod)
|
||||
|
||||
//==== End: Additional Code for NSTextView ====================================
|
339
Source/xheadless/HeadlessServerEvent.m
Normal file
339
Source/xheadless/HeadlessServerEvent.m
Normal file
|
@ -0,0 +1,339 @@
|
|||
/*
|
||||
HeadlessServerEvent - Window/Event code for X11 backends.
|
||||
|
||||
Copyright (C) 1998,2002,2023 Free Software Foundation, Inc.
|
||||
|
||||
Re-written by: Gregory John Casamento <greg.casamento@gmail.com>
|
||||
Based on work by: Marcian Lytwyn <gnustep@advcsi.com> for Keysight
|
||||
Based on work Written by: Adam Fedor <fedor@gnu.org>
|
||||
Date: 1998, Nov 1999, Aug 2023
|
||||
|
||||
This file is part of the GNU Objective C User Interface Library.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; see the file COPYING.LIB.
|
||||
If not, see <http://www.gnu.org/licenses/> or write to the
|
||||
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <AppKit/AppKitExceptions.h>
|
||||
#include <AppKit/NSApplication.h>
|
||||
#include <AppKit/NSGraphics.h>
|
||||
#include <AppKit/NSMenu.h>
|
||||
#include <AppKit/NSPasteboard.h>
|
||||
#include <AppKit/NSWindow.h>
|
||||
#include <Foundation/NSException.h>
|
||||
#include <Foundation/NSArray.h>
|
||||
#include <Foundation/NSDictionary.h>
|
||||
#include <Foundation/NSData.h>
|
||||
#include <Foundation/NSNotification.h>
|
||||
#include <Foundation/NSValue.h>
|
||||
#include <Foundation/NSString.h>
|
||||
#include <Foundation/NSUserDefaults.h>
|
||||
#include <Foundation/NSRunLoop.h>
|
||||
#include <Foundation/NSDebug.h>
|
||||
|
||||
#include "xheadless/XHeadless.h"
|
||||
#include "xheadless/HeadlessServerWindow.h"
|
||||
#include "xheadless/HeadlessInputServer.h"
|
||||
#include "xheadless/HeadlessGeneric.h"
|
||||
|
||||
#include "math.h"
|
||||
|
||||
#if LIB_FOUNDATION_LIBRARY
|
||||
# include <Foundation/NSPosixFileDescriptor.h>
|
||||
#elif defined(NeXT_PDO)
|
||||
# include <Foundation/NSFileHandle.h>
|
||||
# include <Foundation/NSNotification.h>
|
||||
#endif
|
||||
|
||||
#define cWin ((gswindow_device_t*)generic.cachedWindow)
|
||||
|
||||
#if 0
|
||||
// NumLock's mask (it depends on the keyboard mapping)
|
||||
static unsigned int _num_lock_mask;
|
||||
|
||||
// Modifier state
|
||||
static char _shift_pressed = 0;
|
||||
static char _control_pressed = 0;
|
||||
static char _command_pressed = 0;
|
||||
static char _alt_pressed = 0;
|
||||
static char _help_pressed = 0;
|
||||
|
||||
/*
|
||||
Keys used for the modifiers (you may set them with user preferences).
|
||||
Note that the first and second key sym for a modifier must be different.
|
||||
Otherwise, the _*_pressed tracking will be confused.
|
||||
*/
|
||||
static KeySym _control_keysyms[2];
|
||||
static KeySym _command_keysyms[2];
|
||||
static KeySym _alt_keysyms[2];
|
||||
static KeySym _help_keysyms[2];
|
||||
|
||||
static BOOL _is_keyboard_initialized = NO;
|
||||
static BOOL _mod_ignore_shift = NO;
|
||||
|
||||
static BOOL next_event_is_a_keyrepeat;
|
||||
#endif
|
||||
|
||||
void __objc_xgcontextevent_linking (void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#ifdef XSHM
|
||||
@interface NSGraphicsContext (SharedMemory)
|
||||
-(void) gotShmCompletion: (Drawable)d;
|
||||
@end
|
||||
#endif
|
||||
|
||||
@interface HeadlessServer (Private)
|
||||
- (void) receivedEvent: (void*)data
|
||||
type: (RunLoopEventType)type
|
||||
extra: (void*)extra
|
||||
forMode: (NSString*)mode;
|
||||
- (void) setupRunLoopInputSourcesForMode: (NSString*)mode;
|
||||
- (NSDate*) timedOutEvent: (void*)data
|
||||
type: (RunLoopEventType)type
|
||||
forMode: (NSString*)mode;
|
||||
- (int) HeadlessErrorHandler: (Display*)display : (XErrorEvent*)err;
|
||||
- (void) processEvent: (XEvent *) event;
|
||||
- (NSEvent *)_handleTakeFocusAtom: (XEvent)xEvent
|
||||
forContext: (NSGraphicsContext *)gcontext;
|
||||
@end
|
||||
|
||||
|
||||
int
|
||||
HeadlessErrorHandler(Display *display, XErrorEvent *err)
|
||||
{
|
||||
HeadlessServer *ctxt = (HeadlessServer*)GSCurrentServer();
|
||||
|
||||
return [ctxt HeadlessErrorHandler: display : err];
|
||||
}
|
||||
|
||||
@interface HeadlessServer (WindowOps)
|
||||
- (void) styleoffsets: (float *) l : (float *) r : (float *) t : (float *) b
|
||||
: (unsigned int) style : (Window) win;
|
||||
- (NSRect) _XWinRectToOSWinRect: (NSRect)r for: (void*)windowNumber;
|
||||
@end
|
||||
|
||||
@implementation HeadlessServer (EventOps)
|
||||
|
||||
- (int) HeadlessErrorHandler: (Display*)display : (XErrorEvent*)err
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
- (void) setupRunLoopInputSourcesForMode: (NSString*)mode
|
||||
{
|
||||
}
|
||||
|
||||
#if LIB_FOUNDATION_LIBRARY
|
||||
- (void) activity: (NSPosixFileActivities)activity
|
||||
posixFileDescriptor: (NSPosixFileDescriptor*)fileDescriptor
|
||||
{
|
||||
[self receivedEvent: 0 type: 0 extra: 0 forMode: nil];
|
||||
}
|
||||
#elif defined(NeXT_PDO)
|
||||
- (void) activityOnFileHandle: (NSNotification*)notification
|
||||
{
|
||||
id fileDescriptor = [notification object];
|
||||
id runLoopMode = [[NSRunLoop currentRunLoop] currentMode];
|
||||
|
||||
[fileDescriptor waitForDataInBackgroundAndNotifyForModes:
|
||||
[NSArray arrayWithObject: runLoopMode]];
|
||||
[self receivedEvent: 0 type: 0 extra: 0 forMode: nil];
|
||||
}
|
||||
#endif
|
||||
|
||||
- (BOOL) runLoopShouldBlock: (BOOL*)trigger
|
||||
{
|
||||
*trigger = YES; // Should trigger this event
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void) receivedEvent: (void*)data
|
||||
type: (RunLoopEventType)type
|
||||
extra: (void*)extra
|
||||
forMode: (NSString*)mode
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
*/
|
||||
- (NSPoint) _XPointToOSPoint: (NSPoint)x for: (void*)window
|
||||
{
|
||||
return NSMakePoint(0, 0);
|
||||
}
|
||||
|
||||
|
||||
- (void) processEvent: (XEvent *) event
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* WM is asking us to take the keyboard focus
|
||||
*/
|
||||
- (NSEvent *)_handleTakeFocusAtom: (XEvent)xEvent
|
||||
forContext: (NSGraphicsContext *)gcontext
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
#if 0
|
||||
// Return the key_sym corresponding to the user defaults string given,
|
||||
// or fallback if no default is registered.
|
||||
static KeySym key_sym_from_defaults (Display *display, NSUserDefaults *defaults,
|
||||
NSString *keyDefaultKey, KeySym fallback)
|
||||
{
|
||||
return fallback;
|
||||
}
|
||||
|
||||
// This function should be called before any keyboard event is dealed with.
|
||||
static void initialize_keyboard (void)
|
||||
{
|
||||
_is_keyboard_initialized = YES;
|
||||
}
|
||||
|
||||
|
||||
static void set_up_num_lock (void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static BOOL keysym_is_X_modifier (KeySym keysym)
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
static NSEvent* process_key_event (XEvent* xEvent, HeadlessServer* context, NSEventType eventType, NSMutableArray *event_queue)
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
static unichar process_char (KeySym keysym, unsigned *eventModifierFlags)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// process_modifier_flags() determines which modifier keys (Command, Control,
|
||||
// Shift, and so forth) were held down while the event occured.
|
||||
static unsigned int process_modifier_flags(unsigned int state)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
- (NSDate*) timedOutEvent: (void*)data
|
||||
type: (RunLoopEventType)type
|
||||
forMode: (NSString*)mode
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
/* Drag and Drop */
|
||||
- (id <NSDraggingInfo>)dragInfo
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation HeadlessServer (XSync)
|
||||
- (BOOL) xSyncMap: (void*)windowHandle
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation HeadlessServer (X11Ops)
|
||||
|
||||
/*
|
||||
* Return mouse location in base coords ignoring the event loop
|
||||
*/
|
||||
- (NSPoint) mouselocation
|
||||
{
|
||||
return [self mouseLocationOnScreen: defScreen window: NULL];
|
||||
}
|
||||
|
||||
- (NSPoint) mouseLocationOnScreen: (int)screen window: (int *)win
|
||||
{
|
||||
return NSMakePoint(0, 0);
|
||||
}
|
||||
|
||||
- (NSEvent*) getEventMatchingMask: (unsigned)mask
|
||||
beforeDate: (NSDate*)limit
|
||||
inMode: (NSString*)mode
|
||||
dequeue: (BOOL)flag
|
||||
{
|
||||
[self receivedEvent: 0 type: 0 extra: 0 forMode: nil];
|
||||
return [super getEventMatchingMask: mask
|
||||
beforeDate: limit
|
||||
inMode: mode
|
||||
dequeue: flag];
|
||||
}
|
||||
|
||||
- (void) discardEventsMatchingMask: (unsigned)mask
|
||||
beforeEvent: (NSEvent*)limit
|
||||
{
|
||||
[self receivedEvent: 0 type: 0 extra: 0 forMode: nil];
|
||||
[super discardEventsMatchingMask: mask
|
||||
beforeEvent: limit];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation HeadlessServer (TimeKeeping)
|
||||
// Sync time with X server every 10 seconds
|
||||
#define MAX_TIME_DIFF 10
|
||||
// Regard an X time stamp as valid for half a second
|
||||
#define OUT_DATE_TIME_DIFF 0.5
|
||||
|
||||
- (void) setLastTime: (Time)last
|
||||
{
|
||||
if (generic.lastTimeStamp == 0
|
||||
|| generic.baseXServerTime + MAX_TIME_DIFF * 1000 < last)
|
||||
{
|
||||
// We have not sync'ed with the clock for at least
|
||||
// MAX_TIME_DIFF seconds ... so we do it now.
|
||||
generic.lastTimeStamp = [NSDate timeIntervalSinceReferenceDate];
|
||||
generic.baseXServerTime = last;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Optimisation to compute the new time stamp instead.
|
||||
generic.lastTimeStamp += (last - generic.lastTime) / 1000.0;
|
||||
}
|
||||
|
||||
generic.lastTime = last;
|
||||
}
|
||||
|
||||
- (Time) lastTime
|
||||
{
|
||||
// In the case of activation via DO the lastTime is outdated and cannot be used.
|
||||
if (generic.lastTimeStamp == 0
|
||||
|| ((generic.lastTimeStamp + OUT_DATE_TIME_DIFF)
|
||||
< [NSDate timeIntervalSinceReferenceDate]))
|
||||
{
|
||||
return [[NSDate date] timeIntervalSince1970];
|
||||
}
|
||||
else
|
||||
{
|
||||
return generic.lastTime;
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
759
Source/xheadless/HeadlessServerWindow.m
Normal file
759
Source/xheadless/HeadlessServerWindow.m
Normal file
|
@ -0,0 +1,759 @@
|
|||
/* XGServerWindows - methods for window/screen handling
|
||||
|
||||
Copyright (C) 1998,2002,2023 Free Software Foundation, Inc.
|
||||
|
||||
Re-written by: Gregory John Casamento <greg.casamento@gmail.com>
|
||||
Based on work by: Marcian Lytwyn <gnustep@advcsi.com> for Keysight
|
||||
Based on work Written by: Adam Fedor <fedor@gnu.org>
|
||||
Date: Nov 1999, Aug 2023
|
||||
|
||||
This file is part of GNUstep
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; see the file COPYING.LIB.
|
||||
If not, see <http://www.gnu.org/licenses/> or write to the
|
||||
Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <math.h>
|
||||
#include <Foundation/NSString.h>
|
||||
#include <Foundation/NSArray.h>
|
||||
#include <Foundation/NSDebug.h>
|
||||
#include <Foundation/NSValue.h>
|
||||
#include <Foundation/NSProcessInfo.h>
|
||||
#include <Foundation/NSUserDefaults.h>
|
||||
#include <Foundation/NSAutoreleasePool.h>
|
||||
#include <Foundation/NSDebug.h>
|
||||
#include <AppKit/NSEvent.h>
|
||||
#include <Foundation/NSException.h>
|
||||
#include <Foundation/NSThread.h>
|
||||
#include <AppKit/DPSOperators.h>
|
||||
#include <AppKit/NSApplication.h>
|
||||
#include <AppKit/NSCursor.h>
|
||||
#include <AppKit/NSGraphics.h>
|
||||
#include <AppKit/NSWindow.h>
|
||||
#include <AppKit/NSImage.h>
|
||||
#include <AppKit/NSBitmapImageRep.h>
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <xheadless/HeadlessServerWindow.h>
|
||||
#include <xheadless/HeadlessGeneric.h>
|
||||
#include <xheadless/XWindowBuffer.h>
|
||||
#include <xheadless/HeadlessServer.h>
|
||||
|
||||
#define ROOT generic.appRootWindow
|
||||
|
||||
static BOOL handlesWindowDecorations = YES;
|
||||
|
||||
#define WINDOW_WITH_TAG(windowNumber) (gswindow_device_t *)NSMapGet(windowtags, (void *)(uintptr_t)windowNumber)
|
||||
|
||||
/* Keep track of windows */
|
||||
static NSMapTable *windowmaps = NULL;
|
||||
static NSMapTable *windowtags = NULL;
|
||||
|
||||
/* Track used window numbers */
|
||||
static int last_win_num = 0;
|
||||
|
||||
|
||||
@interface NSCursor (BackendPrivate)
|
||||
- (void *)_cid;
|
||||
@end
|
||||
|
||||
@interface NSBitmapImageRep (GSPrivate)
|
||||
- (NSBitmapImageRep *) _convertToFormatBitsPerSample: (NSInteger)bps
|
||||
samplesPerPixel: (NSInteger)spp
|
||||
hasAlpha: (BOOL)alpha
|
||||
isPlanar: (BOOL)isPlanar
|
||||
colorSpaceName: (NSString*)colorSpaceName
|
||||
bitmapFormat: (NSBitmapFormat)bitmapFormat
|
||||
bytesPerRow: (NSInteger)rowBytes
|
||||
bitsPerPixel: (NSInteger)pixelBits;
|
||||
@end
|
||||
|
||||
void __objc_xgcontextwindow_linking (void)
|
||||
{
|
||||
}
|
||||
|
||||
@interface NSEvent (WindowHack)
|
||||
- (void) _patchLocation: (NSPoint)loc;
|
||||
@end
|
||||
|
||||
@implementation NSEvent (WindowHack)
|
||||
- (void) _patchLocation: (NSPoint)loc
|
||||
{
|
||||
location_point = loc;
|
||||
}
|
||||
@end
|
||||
|
||||
@interface HeadlessServer (WindowOps)
|
||||
- (gswindow_device_t *) _rootWindowForScreen: (int)screen;
|
||||
- (void) styleoffsets: (float *) l : (float *) r : (float *) t : (float *) b
|
||||
: (unsigned int) style : (Window) win;
|
||||
- (void) _setSupportedWMProtocols: (gswindow_device_t *) window;
|
||||
@end
|
||||
|
||||
@implementation HeadlessServer (WindowOps)
|
||||
|
||||
- (BOOL) handlesWindowDecorations
|
||||
{
|
||||
return handlesWindowDecorations;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Where a window has been reparented by the wm, we use this method to
|
||||
* locate the window given knowledge of its border window.
|
||||
*/
|
||||
+ (gswindow_device_t *) _windowForXParent: (Window)xWindow
|
||||
{
|
||||
NSMapEnumerator enumerator;
|
||||
void *key;
|
||||
gswindow_device_t *d;
|
||||
|
||||
enumerator = NSEnumerateMapTable(windowmaps);
|
||||
while (NSNextMapEnumeratorPair(&enumerator, &key, (void**)&d) == YES)
|
||||
{
|
||||
if (d->root != d->parent && d->parent == xWindow)
|
||||
{
|
||||
return d;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
+ (gswindow_device_t *) _windowForXWindow: (Window)xWindow
|
||||
{
|
||||
return NSMapGet(windowmaps, (void *)xWindow);
|
||||
}
|
||||
|
||||
+ (gswindow_device_t *) _windowWithTag: (int)windowNumber
|
||||
{
|
||||
return WINDOW_WITH_TAG(windowNumber);
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert a window frame in OpenStep absolute screen coordinates to
|
||||
* a frame in X absolute screen coordinates by flipping an applying
|
||||
* offsets to allow for the X window decorations.
|
||||
* The result is the rectangle of the window we can actually draw
|
||||
* to (in the X coordinate system).
|
||||
*/
|
||||
- (NSRect) _OSFrameToXFrame: (NSRect)o for: (void*)window
|
||||
{
|
||||
return NSMakeRect(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert a window frame in OpenStep absolute screen coordinates to
|
||||
* a frame suitable for setting X hints for a window manager.
|
||||
* NB. Hints use the coordinates of the parent decoration window,
|
||||
* but the size of the actual window.
|
||||
*/
|
||||
- (NSRect) _OSFrameToXHints: (NSRect)o for: (void*)window
|
||||
{
|
||||
return NSMakeRect(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert a rectangle in X coordinates relative to the X-window
|
||||
* to a rectangle in OpenStep coordinates (base coordinates of the NSWindow).
|
||||
*/
|
||||
- (NSRect) _XWinRectToOSWinRect: (NSRect)x for: (void*)window
|
||||
{
|
||||
return NSMakeRect(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert a window frame in X absolute screen coordinates to a frame
|
||||
* in OpenStep absolute screen coordinates by flipping an applying
|
||||
* offsets to allow for the X window decorations.
|
||||
*/
|
||||
- (NSRect) _XFrameToOSFrame: (NSRect)x for: (void*)window
|
||||
{
|
||||
return NSMakeRect(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert a window frame in X absolute screen coordinates to
|
||||
* a frame suitable for setting X hints for a window manager.
|
||||
*/
|
||||
- (NSRect) _XFrameToXHints: (NSRect)o for: (void*)window
|
||||
{
|
||||
return NSMakeRect(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
- (void)_sendRoot: (Window)root
|
||||
type: (Atom)type
|
||||
window: (Window)window
|
||||
data0: (long)data0
|
||||
data1: (long)data1
|
||||
data2: (long)data2
|
||||
data3: (long)data3
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if the window manager supports a feature.
|
||||
*/
|
||||
- (BOOL) _checkWMSupports: (Atom)feature
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
Bool _get_next_prop_new_event(Display *display, XEvent *event, char *arg)
|
||||
{
|
||||
return False;
|
||||
}
|
||||
|
||||
- (BOOL) _tryRequestFrameExtents: (gswindow_device_t *)window
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL) _checkStyle: (unsigned)style
|
||||
{
|
||||
NSDebugLLog(@"Offset", @"Checking offsets for style %d\n", style);
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (XGWMProtocols) _checkWindowManager
|
||||
{
|
||||
return XGWM_UNKNOWN;
|
||||
}
|
||||
|
||||
- (gswindow_device_t *) _rootWindowForScreen: (int)screen
|
||||
{
|
||||
gswindow_device_t *window;
|
||||
|
||||
/* Screen number is negative to avoid conflict with windows */
|
||||
window = WINDOW_WITH_TAG(-screen);
|
||||
if (window)
|
||||
return window;
|
||||
|
||||
window = NSAllocateCollectable(sizeof(gswindow_device_t), NSScannedOption);
|
||||
memset(window, '\0', sizeof(gswindow_device_t));
|
||||
|
||||
window->display = dpy;
|
||||
window->screen = screen;
|
||||
window->ident = 0; //RootWindow(dpy, screen);
|
||||
window->root = window->ident;
|
||||
window->type = NSBackingStoreNonretained;
|
||||
window->number = -screen;
|
||||
window->map_state = IsViewable;
|
||||
window->visibility = -1;
|
||||
window->wm_state = NormalState;
|
||||
window->xframe = NSMakeRect(0, 0, 0, 0);
|
||||
NSMapInsert (windowtags, (void*)(uintptr_t)window->number, window);
|
||||
NSMapInsert (windowmaps, (void*)(uintptr_t)window->ident, window);
|
||||
return window;
|
||||
}
|
||||
|
||||
/* Create the window and screen list if necessary, add the root window to
|
||||
the window list as window 0 */
|
||||
- (void) _checkWindowlist
|
||||
{
|
||||
if (windowmaps)
|
||||
return;
|
||||
|
||||
windowmaps = NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks,
|
||||
NSNonOwnedPointerMapValueCallBacks, 20);
|
||||
windowtags = NSCreateMapTable(NSIntMapKeyCallBacks,
|
||||
NSNonOwnedPointerMapValueCallBacks, 20);
|
||||
}
|
||||
|
||||
- (void) _setupMouse
|
||||
{
|
||||
}
|
||||
|
||||
- (void) _setSupportedWMProtocols: (gswindow_device_t *) window
|
||||
{
|
||||
}
|
||||
|
||||
- (void) _setupRootWindow
|
||||
{
|
||||
/*
|
||||
* Initialize time of last events to be the start of time - not
|
||||
* the current time!
|
||||
*/
|
||||
generic.lastClick = 1;
|
||||
generic.lastMotion = 1;
|
||||
generic.lastTime = 1;
|
||||
|
||||
/*
|
||||
* Set up standard atoms.
|
||||
*/
|
||||
|
||||
[self _checkWindowlist];
|
||||
handlesWindowDecorations = NO;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Destroys all the windows and other window resources that belong to
|
||||
this context */
|
||||
- (void) _destroyServerWindows
|
||||
{
|
||||
void *key;
|
||||
gswindow_device_t *d;
|
||||
NSMapEnumerator enumerator;
|
||||
NSMapTable *mapcopy;
|
||||
|
||||
/* Have to get a copy, since termwindow will remove them from
|
||||
the map table */
|
||||
mapcopy = NSCopyMapTableWithZone(windowtags, [self zone]);
|
||||
enumerator = NSEnumerateMapTable(mapcopy);
|
||||
while (NSNextMapEnumeratorPair(&enumerator, &key, (void**)&d) == YES)
|
||||
{
|
||||
if (d->display == dpy && d->ident != d->root)
|
||||
[self termwindow: (NSInteger)(intptr_t)key];
|
||||
}
|
||||
NSFreeMapTable(mapcopy);
|
||||
}
|
||||
|
||||
/* Sets up a backing pixmap when a window is created or resized. This is
|
||||
only done if the Window is buffered or retained. */
|
||||
- (void) _createBuffer: (gswindow_device_t *)window
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
* Code to build up a NET WM icon from our application icon
|
||||
*/
|
||||
|
||||
-(BOOL) _createNetIcon: (NSImage*)image
|
||||
result: (long**)pixeldata
|
||||
size: (int*)size
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void) _setNetWMIconFor: (Window) window
|
||||
{
|
||||
}
|
||||
|
||||
- (int) window: (NSRect)frame
|
||||
: (NSBackingStoreType)type
|
||||
: (unsigned int)style
|
||||
: (int)screen
|
||||
{
|
||||
gswindow_device_t *window;
|
||||
|
||||
NSDebugLLog(@"XGTrace", @"DPSwindow: %@ %d", NSStringFromRect(frame), (int)type);
|
||||
|
||||
/* Create the window structure and set the style early so we can use it to
|
||||
convert frames. */
|
||||
window = NSAllocateCollectable(sizeof(gswindow_device_t), NSScannedOption);
|
||||
memset(window, '\0', sizeof(gswindow_device_t));
|
||||
|
||||
/*
|
||||
* FIXME - should this be protected by a lock for thread safety?
|
||||
* generate a unique tag for this new window.
|
||||
*/
|
||||
do
|
||||
{
|
||||
last_win_num++;
|
||||
}
|
||||
while (last_win_num == 0 || WINDOW_WITH_TAG(last_win_num) != 0);
|
||||
window->number = last_win_num;
|
||||
|
||||
// Insert window into the mapping
|
||||
NSMapInsert(windowmaps, (void*)(uintptr_t)window->ident, window);
|
||||
NSMapInsert(windowtags, (void*)(uintptr_t)window->number, window);
|
||||
[self _setWindowOwnedByServer: window->number];
|
||||
|
||||
return window->number;
|
||||
}
|
||||
|
||||
- (int) nativeWindow: (void *)winref : (NSRect*)frame : (NSBackingStoreType*)type
|
||||
: (unsigned int*)style : (int*)screen
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
- (void) termwindow: (int)win
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the offsets between the window content-view and it's frame
|
||||
* depending on the window style.
|
||||
*/
|
||||
- (void) styleoffsets: (float *) l : (float *) r : (float *) t : (float *) b
|
||||
: (unsigned int) style
|
||||
{
|
||||
[self styleoffsets: l : r : t : b : style : (Window) 0];
|
||||
}
|
||||
|
||||
- (void) styleoffsets: (float *) l : (float *) r : (float *) t : (float *) b
|
||||
: (unsigned int) style : (Window) win
|
||||
{
|
||||
}
|
||||
|
||||
- (void) stylewindow: (unsigned int)style : (int) win
|
||||
{
|
||||
}
|
||||
|
||||
- (void) setbackgroundcolor: (NSColor *)color : (int)win
|
||||
{
|
||||
}
|
||||
|
||||
- (void) windowbacking: (NSBackingStoreType)type : (int) win
|
||||
{
|
||||
}
|
||||
|
||||
- (void) titlewindow: (NSString *)window_title : (int) win
|
||||
{
|
||||
}
|
||||
|
||||
- (void) docedited: (int)edited : (int) win
|
||||
{
|
||||
}
|
||||
|
||||
- (BOOL) appOwnsMiniwindow
|
||||
{
|
||||
return generic.flags.appOwnsMiniwindow;
|
||||
}
|
||||
|
||||
- (void) miniwindow: (int) win
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
Make sure we have the most up-to-date window information and then
|
||||
make sure the context has our new information
|
||||
*/
|
||||
- (void) setWindowdevice: (int)win forContext: (NSGraphicsContext *)ctxt
|
||||
{
|
||||
}
|
||||
|
||||
-(int) _createAppIconPixmaps
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
- (void) orderwindow: (int)op : (int)otherWin : (int)winNum
|
||||
{
|
||||
}
|
||||
|
||||
#define ALPHA_THRESHOLD 158
|
||||
|
||||
/* Restrict the displayed part of the window to the given image.
|
||||
This only yields usefull results if the window is borderless and
|
||||
displays the image itself */
|
||||
- (void) restrictWindow: (int)win toImage: (NSImage*)image
|
||||
{
|
||||
}
|
||||
|
||||
/* This method is a fast implementation of move that only works
|
||||
correctly for borderless windows. Use with caution. */
|
||||
- (void) movewindow: (NSPoint)loc : (int)win
|
||||
{
|
||||
}
|
||||
|
||||
- (void) placewindow: (NSRect)rect : (int)win
|
||||
{
|
||||
}
|
||||
|
||||
- (BOOL) findwindow: (NSPoint)loc : (int) op : (int) otherWin : (NSPoint *)floc
|
||||
: (int*) winFound
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (NSRect) windowbounds: (int)win
|
||||
{
|
||||
|
||||
return NSMakeRect(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
- (void) setwindowlevel: (int)level : (int)win
|
||||
{
|
||||
}
|
||||
|
||||
- (int) windowlevel: (int)win
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
- (NSArray *) windowlist
|
||||
{
|
||||
return [NSMutableArray array];
|
||||
}
|
||||
|
||||
- (int) windowdepth: (int)win
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
- (void) setmaxsize: (NSSize)size : (int)win
|
||||
{
|
||||
}
|
||||
|
||||
- (void) setminsize: (NSSize)size : (int)win
|
||||
{
|
||||
}
|
||||
|
||||
- (void) setresizeincrements: (NSSize)size : (int)win
|
||||
{
|
||||
}
|
||||
|
||||
// process expose event
|
||||
- (void) _addExposedRectangle: (XRectangle)rectangle : (int)win : (BOOL) ignoreBacking
|
||||
{
|
||||
}
|
||||
|
||||
- (void) flushwindowrect: (NSRect)rect : (int)win
|
||||
{
|
||||
}
|
||||
|
||||
// handle X expose events
|
||||
- (void) _processExposedRectangles: (int)win
|
||||
{
|
||||
}
|
||||
|
||||
- (BOOL) capturemouse: (int)win
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void) setMouseLocation: (NSPoint)mouseLocation onScreen: (int)aScreen
|
||||
{
|
||||
}
|
||||
|
||||
- (void) setinputfocus: (int)win
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
* Instruct window manager that the specified window is 'key', 'main', or
|
||||
* just a normal window.
|
||||
*/
|
||||
- (void) setinputstate: (int)st : (int)win
|
||||
{
|
||||
}
|
||||
|
||||
/** Sets the transparancy value for the whole window */
|
||||
- (void) setalpha: (float)alpha : (int) win
|
||||
{
|
||||
}
|
||||
|
||||
- (float) getAlpha: (int)win
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
- (void *) serverDevice
|
||||
{
|
||||
return dpy;
|
||||
}
|
||||
|
||||
- (void *) windowDevice: (int)win
|
||||
{
|
||||
return (void *)NULL;
|
||||
}
|
||||
|
||||
/* Cursor Ops */
|
||||
static BOOL cursor_hidden = NO;
|
||||
|
||||
- (Cursor) _blankCursor
|
||||
{
|
||||
return None;
|
||||
}
|
||||
|
||||
/*
|
||||
set the cursor for a newly created window.
|
||||
*/
|
||||
|
||||
- (void) _initializeCursorForXWindow: (Window) win
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
set cursor on all XWindows we own. if `set' is NO
|
||||
the cursor is unset on all windows.
|
||||
Normally the cursor `c' correspond to the [NSCursor currentCursor]
|
||||
The only exception should be when the cursor is hidden.
|
||||
In that case `c' will be a blank cursor.
|
||||
*/
|
||||
|
||||
- (void) _DPSsetcursor: (Cursor)c : (BOOL)set
|
||||
{
|
||||
}
|
||||
|
||||
#define ALPHA_THRESHOLD 158
|
||||
|
||||
Pixmap
|
||||
xgps_cursor_mask(Display *xdpy, Drawable draw, const unsigned char *data,
|
||||
int w, int h, int colors)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
Pixmap
|
||||
xgps_cursor_image(Display *xdpy, Drawable draw, const unsigned char *data,
|
||||
int w, int h, int colors, XColor *fg, XColor *bg)
|
||||
{
|
||||
return None;
|
||||
}
|
||||
|
||||
- (void) hidecursor
|
||||
{
|
||||
cursor_hidden = YES;
|
||||
}
|
||||
|
||||
- (void) showcursor
|
||||
{
|
||||
cursor_hidden = NO;
|
||||
}
|
||||
|
||||
- (void) standardcursor: (int)style : (void **)cid
|
||||
{
|
||||
}
|
||||
|
||||
- (void) imagecursor: (NSPoint)hotp : (NSImage *)image : (void **)cid
|
||||
{
|
||||
}
|
||||
|
||||
- (void) recolorcursor: (NSColor *)fg : (NSColor *)bg : (void*) cid
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
- (void) setcursor: (void*) cid
|
||||
{
|
||||
}
|
||||
|
||||
- (void) freecursor: (void*) cid
|
||||
{
|
||||
}
|
||||
|
||||
- (NSArray *)screenList
|
||||
{
|
||||
NSMutableArray *screens = [NSMutableArray arrayWithCapacity: 1];
|
||||
[screens addObject: [NSNumber numberWithInt: defScreen]];
|
||||
|
||||
return screens;
|
||||
}
|
||||
|
||||
- (NSWindowDepth) windowDepthForScreen: (int) screen_num
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
- (const NSWindowDepth *) availableDepthsForScreen: (int) screen_num
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
- (NSSize) resolutionForScreen: (int)screen_num
|
||||
{
|
||||
// NOTE:
|
||||
// -gui now trusts the return value of resolutionForScreen:,
|
||||
// so if it is not {72, 72} then the entire UI will be scaled.
|
||||
//
|
||||
// I commented out the implementation below because it may not
|
||||
// be safe to use the DPI value we get from the X server.
|
||||
// (i.e. I don't know if it will be a "fake" DPI like 72 or 96,
|
||||
// or a real measurement reported from the monitor's firmware
|
||||
// (possibly incorrect?))
|
||||
// More research needs to be done.
|
||||
|
||||
return NSMakeSize(72, 72);
|
||||
}
|
||||
|
||||
- (NSRect) boundsForScreen: (int)screen
|
||||
{
|
||||
return NSMakeRect(0, 0, 400, 400);
|
||||
}
|
||||
|
||||
- (NSImage *) iconTileImage
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (NSSize) iconSize
|
||||
{
|
||||
return [super iconSize];
|
||||
}
|
||||
|
||||
- (unsigned int) numberOfDesktops: (int)screen
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
- (NSArray *) namesOfDesktops: (int)screen
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (unsigned int) desktopNumberForScreen: (int)screen
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
- (void) setDesktopNumber: (unsigned int)workspace forScreen: (int)screen
|
||||
{
|
||||
}
|
||||
|
||||
- (unsigned int) desktopNumberForWindow: (int)win
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
- (void) setDesktopNumber: (unsigned int)workspace forWindow: (int)win
|
||||
{
|
||||
}
|
||||
|
||||
- (void) setShadow: (BOOL)hasShadow : (int)win
|
||||
{
|
||||
}
|
||||
|
||||
- (BOOL) hasShadow: (int)win
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check whether the window is miniaturized according to the ICCCM window
|
||||
* state property.
|
||||
*/
|
||||
- (int) _wm_state: (Window)win
|
||||
{
|
||||
return WithdrawnState;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check whether the EWMH window state includes the _NET_WM_STATE_HIDDEN
|
||||
* state. On EWMH, a window is iconified if it is iconic state and the
|
||||
* _NET_WM_STATE_HIDDEN is present.
|
||||
*/
|
||||
- (BOOL) _ewmh_isHidden: (Window)win
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void) setParentWindow: (int)parentWin
|
||||
forChildWindow: (int)childWin
|
||||
{
|
||||
}
|
||||
|
||||
- (void) setIgnoreMouse: (BOOL)ignoreMouse : (int)win
|
||||
{
|
||||
}
|
||||
|
||||
@end
|
15
Tools/gpbs.m
15
Tools/gpbs.m
|
@ -38,12 +38,7 @@
|
|||
#endif
|
||||
|
||||
#include <signal.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#else
|
||||
#include <io.h>
|
||||
#define strcasecmp _stricmp
|
||||
#endif
|
||||
#include <ctype.h>
|
||||
|
||||
#ifdef __MINGW__
|
||||
|
@ -234,8 +229,7 @@ NSMutableDictionary *pasteboards = nil;
|
|||
{
|
||||
if (verbose)
|
||||
{
|
||||
NSLog(@"-data (%llu bytes) provided for %@",
|
||||
(unsigned long long)[data length], self);
|
||||
NSLog(@"-data for %@", self);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
@ -291,8 +285,7 @@ NSMutableDictionary *pasteboards = nil;
|
|||
ASSIGN(data, d);
|
||||
if (verbose)
|
||||
{
|
||||
NSLog(@"-setData: (%llu bytes) for %@",
|
||||
(unsigned long long)[data length], self);
|
||||
NSLog(@"-setData: for %@", self);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -870,8 +863,8 @@ NSMutableDictionary *pasteboards = nil;
|
|||
e = [self entryByCount: count];
|
||||
if (verbose)
|
||||
{
|
||||
NSLog(@"%@ set data %p (%llu bytes) for type '%@' version %d in %@",
|
||||
self, data, (unsigned long long)[data length], type, count, e);
|
||||
NSLog(@"%@ set data %p for type '%@' version %d in %@",
|
||||
self, data, type, count, e);
|
||||
}
|
||||
if (e)
|
||||
{
|
||||
|
|
|
@ -40,18 +40,6 @@
|
|||
#include <sys/file.h>
|
||||
#endif
|
||||
|
||||
// The Windows SDK declares BOOL as an int. Objective C defines BOOl as a char.
|
||||
// Those two types clash. MinGW's implementation of the Windows SDK uses the WINBOOL
|
||||
// type to avoid this clash. When compiling natively on Windows, we need to manually
|
||||
// define WINBOOL.
|
||||
// MinGW will define _DEF_WINBOOL_ if it has defined WINBOOL so we can use the same trick
|
||||
// here.
|
||||
// See https://github.com/mingw-w64/mingw-w64/blob/master/mingw-w64-headers/include/ntdef.h#L355
|
||||
#ifndef _DEF_WINBOOL_
|
||||
#define _DEF_WINBOOL_
|
||||
typedef int WINBOOL;
|
||||
#endif
|
||||
|
||||
@interface Win32PbOwner : NSObject
|
||||
{
|
||||
NSPasteboard *_pb;
|
||||
|
|
1074
Tools/xpbs.m
1074
Tools/xpbs.m
File diff suppressed because it is too large
Load diff
6
Version
6
Version
|
@ -3,12 +3,12 @@
|
|||
|
||||
# The version number of this release.
|
||||
GNUSTEP_BACK_MAJOR_VERSION=0
|
||||
GNUSTEP_BACK_MINOR_VERSION=32
|
||||
GNUSTEP_BACK_MINOR_VERSION=30
|
||||
GNUSTEP_BACK_SUBMINOR_VERSION=0
|
||||
# This numeric value should match above
|
||||
VERSION_NUMBER=032.0
|
||||
VERSION_NUMBER=030.0
|
||||
# This numeric value should match the compatible gui interface version
|
||||
INTERFACE_VERSION_NUMBER=032
|
||||
INTERFACE_VERSION_NUMBER=030
|
||||
|
||||
GNUSTEP_BACK_VERSION=${GNUSTEP_BACK_MAJOR_VERSION}.${GNUSTEP_BACK_MINOR_VERSION}.${GNUSTEP_BACK_SUBMINOR_VERSION}
|
||||
VERSION=${GNUSTEP_BACK_VERSION}
|
||||
|
|
57
config.h.in
57
config.h.in
|
@ -1,17 +1,18 @@
|
|||
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
|
||||
#define SERVER_x11 1
|
||||
#define SERVER_win32 2
|
||||
#define SERVER_wayland 3
|
||||
#define SERVER_headless 4
|
||||
#define GRAPHICS_xdps 0
|
||||
#define GRAPHICS_art 1
|
||||
#define GRAPHICS_xlib 2
|
||||
#define GRAPHICS_winlib 3
|
||||
#define GRAPHICS_cairo 4
|
||||
#define GRAPHICS_opal 5
|
||||
#define GRAPHICS_headless 6
|
||||
#define SERVER_x11 1
|
||||
#define SERVER_win32 2
|
||||
#define SERVER_wayland 3
|
||||
#define SERVER_xheadless 4
|
||||
|
||||
#define GRAPHICS_xdps 0
|
||||
#define GRAPHICS_art 1
|
||||
#define GRAPHICS_xlib 2
|
||||
#define GRAPHICS_winlib 3
|
||||
#define GRAPHICS_cairo 4
|
||||
#define GRAPHICS_opal 5
|
||||
#define GRAPHICS_headlesslib 6
|
||||
|
||||
|
||||
/* Define to type of graphics context to build */
|
||||
|
@ -44,33 +45,27 @@
|
|||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define to 1 if you have the `wayland-client' library (-lwayland-client). */
|
||||
#undef HAVE_LIBWAYLAND_CLIENT
|
||||
|
||||
/* Define to 1 if you have the `Xext' library (-lXext). */
|
||||
#undef HAVE_LIBXEXT
|
||||
|
||||
/* Define to 1 if you have the `Xft' library (-lXft). */
|
||||
#undef HAVE_LIBXFT
|
||||
|
||||
/* Define to 1 if you have the `xkbcommon' library (-lxkbcommon). */
|
||||
#undef HAVE_LIBXKBCOMMON
|
||||
|
||||
/* Define to 1 if you have the `Xmu' library (-lXmu). */
|
||||
#undef HAVE_LIBXMU
|
||||
|
||||
/* Define to 1 if you have the `Xt' library (-lXt). */
|
||||
#undef HAVE_LIBXT
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define to 1 if you have the `shmctl' function. */
|
||||
#undef HAVE_SHMCTL
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdio.h> header file. */
|
||||
#undef HAVE_STDIO_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
|
@ -101,9 +96,6 @@
|
|||
/* Define if you have XftDrawStringUtf8 */
|
||||
#undef HAVE_UTF8
|
||||
|
||||
/* Define to 1 if you have the <wayland-util.h> header file. */
|
||||
#undef HAVE_WAYLAND_UTIL_H
|
||||
|
||||
/* Define if you have the wgl library */
|
||||
#undef HAVE_WGL
|
||||
|
||||
|
@ -113,9 +105,6 @@
|
|||
/* Define to 1 if you have the <X11/extensions/sync.h> header file. */
|
||||
#undef HAVE_X11_EXTENSIONS_SYNC_H
|
||||
|
||||
/* Define to 1 if you have the <X11/extensions/Xrandr.h> header file. */
|
||||
#undef HAVE_X11_EXTENSIONS_XRANDR_H
|
||||
|
||||
/* Define to 1 if you have the <X11/extensions/XShm.h> header file. */
|
||||
#undef HAVE_X11_EXTENSIONS_XSHM_H
|
||||
|
||||
|
@ -132,18 +121,15 @@
|
|||
/* Define to 1 if you have 'XInternAtoms' function. */
|
||||
#undef HAVE_XINTERNATOMS
|
||||
|
||||
/* Define to 1 if you have the <xkbcommon/xkbcommon.h> header file. */
|
||||
#undef HAVE_XKBCOMMON_XKBCOMMON_H
|
||||
|
||||
/* Define to enable Xrandr support */
|
||||
#undef HAVE_XRANDR
|
||||
|
||||
/* Define to enable Xshape support */
|
||||
#undef HAVE_XSHAPE
|
||||
|
||||
/* Define to 1 if you have the `Xutf8LookupString' function. */
|
||||
#undef HAVE_XUTF8LOOKUPSTRING
|
||||
|
||||
/* Define to enable Xrandr support */
|
||||
#undef HAVE_XRANDR
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
|
@ -156,15 +142,10 @@
|
|||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#undef PACKAGE_URL
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* Define to 1 if all of the C90 standard headers exist (not just the ones
|
||||
required in a freestanding environment). This macro is provided for
|
||||
backward compatibility; new code need not use it. */
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define to enable glitz support */
|
||||
|
|
32
configure
vendored
32
configure
vendored
|
@ -1438,8 +1438,8 @@ Optional Features:
|
|||
--disable-xim Disable XIM support
|
||||
--disable-wgl Disable WGL support
|
||||
--enable-glitz Enable Glitz support
|
||||
--enable-server=SRV Build server type: x11, win32, wayland, headless
|
||||
--enable-graphics=GPH Build graphics: xlib, xdps, winlib, art, cairo, opal, headless
|
||||
--enable-server=SRV Build server type: x11, win32, wayland, xheadless
|
||||
--enable-graphics=GPH Build graphics: xlib, xdps, winlib, art, cairo, opal, headlesslib
|
||||
|
||||
Optional Packages:
|
||||
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
|
||||
|
@ -4745,6 +4745,9 @@ fi
|
|||
if test "x$no_x" = xyes; then
|
||||
set_x_paths=no
|
||||
fi
|
||||
if test "x$BUILD_SERVER" = xxheadless; then
|
||||
set_x_paths=no
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
@ -7615,6 +7618,12 @@ fi
|
|||
|
||||
BUILD_SERVER=$enable_server
|
||||
BUILD_GRAPHICS="$enable_graphics"
|
||||
|
||||
# Force the graphics to be headless if the server is...
|
||||
if test "x$BUILD_SERVER" = xxheadless; then
|
||||
BUILD_GRAPHICS=headlesslib
|
||||
fi
|
||||
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Backend Server" >&5
|
||||
printf %s "checking Backend Server... " >&6; }
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $BUILD_SERVER" >&5
|
||||
|
@ -7826,12 +7835,27 @@ fi
|
|||
CAIRO_LIBS="$CAIRO_LIBS $XFT_LIBS"
|
||||
CAIRO_CFLAGS="$CAIRO_CFLAGS"
|
||||
LIBS="-lwayland-client -lwayland-cursor -lxkbcommon $LIBS"
|
||||
else
|
||||
as_fn_error $? "Invalid Cairo installation" "$LINENO" 5
|
||||
fi
|
||||
LIBS="$CAIRO_LIBS $LIBS"
|
||||
CPPFLAGS="$CAIRO_CFLAGS $CPPFLAGS"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test x"$BUILD_GRAPHICS" = "xheadlesslib"; then
|
||||
if test $BUILD_SERVER != xheadless; then
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Invalid build server for headless lib: $BUILD_SERVER" >&5
|
||||
printf "%s\n" "$as_me: WARNING: Invalid build server for headless lib: $BUILD_SERVER" >&2;}
|
||||
else
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking headless lib" >&5
|
||||
printf %s "checking headless lib... " >&6; }
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: headlesslib" >&5
|
||||
printf "%s\n" "headlesslib" >&6; }
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if test x"$BUILD_GRAPHICS" = "xxdps"; then
|
||||
CPPFLAGS="-I$x_includes/X11 $CPPFLAGS"
|
||||
LIBS="-ldpstk -ldps -lpsres -lXt $X_PRE_LIBS $LIBS"
|
||||
|
@ -7864,6 +7888,8 @@ printf "%s\n" "$as_me: Switching to $BUILD_GRAPHICS" >&6;}
|
|||
fi
|
||||
elif test x"$BUILD_GRAPHICS" = "xxlib"; then
|
||||
LIBS="$FREETYPE_LIBS $LIBS"
|
||||
elif test x"$BUILD_GRAPHICS" = "xheadlesslib"; then
|
||||
: # Nothing to do
|
||||
elif test x"$BUILD_GRAPHICS" = "xwinlib"; then
|
||||
: # Nothing to do
|
||||
elif test x"$BUILD_GRAPHICS" = "xopal"; then
|
||||
|
@ -7891,8 +7917,6 @@ printf "%s\n" "$as_me: WARNING: can't find fontconfig, required for graphics=opa
|
|||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: Switching to $BUILD_GRAPHICS" >&5
|
||||
printf "%s\n" "$as_me: Switching to $BUILD_GRAPHICS" >&6;}
|
||||
fi
|
||||
elif test x"$BUILD_GRAPHICS" = "xheadless"; then
|
||||
: # Nothing to do
|
||||
else
|
||||
as_fn_error $? "Invalid graphics backend $BUILD_GRAPHICS" "$LINENO" 5
|
||||
fi
|
||||
|
|
51
configure.ac
51
configure.ac
|
@ -161,6 +161,9 @@ AC_PATH_XTRA
|
|||
if test "x$no_x" = xyes; then
|
||||
set_x_paths=no
|
||||
fi
|
||||
if test "x$BUILD_SERVER" = xxheadless; then
|
||||
set_x_paths=no
|
||||
fi
|
||||
|
||||
PKG_PROG_PKG_CONFIG
|
||||
|
||||
|
@ -565,14 +568,20 @@ case $target_os in
|
|||
esac
|
||||
|
||||
AC_ARG_ENABLE(server,
|
||||
[ --enable-server=SRV Build server type: x11, win32, wayland, headless],,
|
||||
[ --enable-server=SRV Build server type: x11, win32, wayland, xheadless],,
|
||||
enable_server=$BUILD_SERVER)
|
||||
AC_ARG_ENABLE(graphics,
|
||||
[ --enable-graphics=GPH Build graphics: xlib, xdps, winlib, art, cairo, opal, headless],,
|
||||
[ --enable-graphics=GPH Build graphics: xlib, xdps, winlib, art, cairo, opal, headlesslib],,
|
||||
enable_graphics="$BUILD_GRAPHICS")
|
||||
|
||||
BUILD_SERVER=$enable_server
|
||||
BUILD_GRAPHICS="$enable_graphics"
|
||||
|
||||
# Force the graphics to be headless if the server is...
|
||||
if test "x$BUILD_SERVER" = xxheadless; then
|
||||
BUILD_GRAPHICS=headlesslib
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(Backend Server)
|
||||
AC_MSG_RESULT($BUILD_SERVER)
|
||||
|
||||
|
@ -658,12 +667,24 @@ if test x"$BUILD_GRAPHICS" = "xcairo"; then
|
|||
CAIRO_LIBS="$CAIRO_LIBS $XFT_LIBS"
|
||||
CAIRO_CFLAGS="$CAIRO_CFLAGS"
|
||||
LIBS="-lwayland-client -lwayland-cursor -lxkbcommon $LIBS"
|
||||
else
|
||||
AC_MSG_ERROR([Invalid Cairo installation])
|
||||
fi
|
||||
LIBS="$CAIRO_LIBS $LIBS"
|
||||
CPPFLAGS="$CAIRO_CFLAGS $CPPFLAGS"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test x"$BUILD_GRAPHICS" = "xheadlesslib"; then
|
||||
if test $BUILD_SERVER != xheadless; then
|
||||
AC_MSG_WARN([Invalid build server for headless lib: $BUILD_SERVER])
|
||||
else
|
||||
AC_MSG_CHECKING(headless lib)
|
||||
AC_MSG_RESULT(headlesslib)
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if test x"$BUILD_GRAPHICS" = "xxdps"; then
|
||||
CPPFLAGS="-I$x_includes/X11 $CPPFLAGS"
|
||||
LIBS="-ldpstk -ldps -lpsres -lXt $X_PRE_LIBS $LIBS"
|
||||
|
@ -692,6 +713,8 @@ elif test x"$BUILD_GRAPHICS" = "xart"; then
|
|||
fi
|
||||
elif test x"$BUILD_GRAPHICS" = "xxlib"; then
|
||||
LIBS="$FREETYPE_LIBS $LIBS"
|
||||
elif test x"$BUILD_GRAPHICS" = "xheadlesslib"; then
|
||||
: # Nothing to do
|
||||
elif test x"$BUILD_GRAPHICS" = "xwinlib"; then
|
||||
: # Nothing to do
|
||||
elif test x"$BUILD_GRAPHICS" = "xopal"; then
|
||||
|
@ -715,8 +738,6 @@ elif test x"$BUILD_GRAPHICS" = "xopal"; then
|
|||
fi
|
||||
AC_MSG_NOTICE([Switching to $BUILD_GRAPHICS])
|
||||
fi
|
||||
elif test x"$BUILD_GRAPHICS" = "xheadless"; then
|
||||
: # Nothing to do
|
||||
else
|
||||
AC_MSG_ERROR([Invalid graphics backend $BUILD_GRAPHICS])
|
||||
fi
|
||||
|
@ -757,17 +778,17 @@ if test $BUILD_SERVER = win32; then
|
|||
fi
|
||||
|
||||
AH_TOP([
|
||||
#define SERVER_x11 1
|
||||
#define SERVER_win32 2
|
||||
#define SERVER_wayland 3
|
||||
#define SERVER_headless 4
|
||||
#define GRAPHICS_xdps 0
|
||||
#define GRAPHICS_art 1
|
||||
#define GRAPHICS_xlib 2
|
||||
#define GRAPHICS_winlib 3
|
||||
#define GRAPHICS_cairo 4
|
||||
#define GRAPHICS_opal 5
|
||||
#define GRAPHICS_headless 6
|
||||
#define SERVER_x11 1
|
||||
#define SERVER_win32 2
|
||||
#define SERVER_wayland 3
|
||||
#define SERVER_xheadless 4
|
||||
#define GRAPHICS_xdps 0
|
||||
#define GRAPHICS_art 1
|
||||
#define GRAPHICS_xlib 2
|
||||
#define GRAPHICS_winlib 3
|
||||
#define GRAPHICS_cairo 4
|
||||
#define GRAPHICS_opal 5
|
||||
#define GRAPHICS_headlesslib 6
|
||||
])
|
||||
AC_DEFINE_UNQUOTED(BUILD_SERVER,SERVER_$BUILD_SERVER,
|
||||
[Define to type of window server to build])
|
||||
|
|
Loading…
Reference in a new issue