Add Cocotron, remove old AppKit, CoreGraphics and OpenGL

This commit is contained in:
Sergey Bugaev 2017-04-24 22:35:11 +03:00
parent dace353d54
commit 31c1afa6ce
11 changed files with 4 additions and 169 deletions

9
.gitmodules vendored
View File

@ -79,9 +79,6 @@
[submodule "src/external/adv_cmds"]
path = src/external/adv_cmds
url = ../darling-adv_cmds.git
[submodule "src/external/AppKit"]
path = src/external/AppKit
url = ../darling-appkit.git
[submodule "src/external/nano"]
path = src/external/nano
url = ../darling-nano.git
@ -190,9 +187,6 @@
[submodule "src/external/configd"]
path = src/external/configd
url = ../darling-configd.git
[submodule "src/external/coregraphics"]
path = src/external/coregraphics
url = ../darling-coregraphics.git
[submodule "src/external/IONetworkingFamily"]
path = src/external/IONetworkingFamily
url = ../darling-IONetworkingFamily.git
@ -242,3 +236,6 @@
[submodule "src/external/Heimdal"]
path = src/external/Heimdal
url = ../darling-Heimdal.git
[submodule "src/external/cocotron"]
path = src/external/cocotron
url = ../darling-cocotron.git

View File

@ -1,16 +0,0 @@
#ifndef CGLCONTEXT_H
#define CGLCONTEXT_H
class CGLContextImpl;
struct CGLContext
{
void* rend;
void* disp;
CGLContextImpl* priv;
void* stak;
};
#endif

View File

@ -1,27 +0,0 @@
#include "CGLContextImpl.h"
CGLContextImpl::CGLContextImpl()
{
pthread_mutexattr_t mta;
pthread_mutexattr_init(&mta);
pthread_mutexattr_settype(&mta, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(&m_lock, &mta);
}
CGLContextImpl::~CGLContextImpl()
{
pthread_mutex_destroy(&m_lock);
}
void CGLContextImpl::lock()
{
pthread_mutex_lock(&m_lock);
}
void CGLContextImpl::unlock()
{
pthread_mutex_unlock(&m_lock);
}

View File

@ -1,18 +0,0 @@
#ifndef CGLCONTEXTIMPL_H
#define CGLCONTEXTIMPL_H
#include <pthread.h>
class CGLContextImpl
{
public:
CGLContextImpl();
virtual ~CGLContextImpl();
void lock();
void unlock();
private:
pthread_mutex_t m_lock;
};
#endif

View File

@ -1,33 +0,0 @@
#ifndef CGLTYPES_H
#define CGLTYPES_H
#include "CGLContext.h"
typedef CGLContext* CGLContextObj;
typedef struct CGLPixelFormat* CGLPixelFormatObj;
enum CGLError
{
kCGLNoError = 0,
kCGLBadAttribute = 10000,
kCGLBadProperty = 10001,
kCGLBadPixelFormat = 10002,
kCGLBadRendererInfo = 10003,
kCGLBadContext = 10004,
kCGLBadDrawable = 10005,
kCGLBadDisplay = 10006,
kCGLBadState = 10007,
kCGLBadValue = 10008,
kCGLBadMatch = 10009,
kCGLBadEnumeration = 10010,
kCGLBadOffScreen = 10011,
kCGLBadFullScreen = 10012,
kCGLBadWindow = 10013,
kCGLBadAddress = 10014,
kCGLBadCodeModule = 10015,
kCGLBadAlloc = 10016,
kCGLBadConnection = 10017
};
#endif

View File

@ -1,29 +0,0 @@
project(OpenGL)
cmake_minimum_required(VERSION 2.4.0)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
#configure_file(config.h.in config.h)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../util)
set(OpenGL_SRCS
CGLContextImpl.cpp
OpenGL.cpp
)
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/darling")
#SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--enable-new-dtags")
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
add_library(OpenGL SHARED ${OpenGL_SRCS})
target_link_libraries(OpenGL util -lGL)
install(TARGETS OpenGL DESTINATION "${CMAKE_INSTALL_LIBDIR}/darling")

View File

@ -1,24 +0,0 @@
#include "CGLTypes.h"
#include "CGLContext.h"
#include "CGLContextImpl.h"
CGLError CGLLockContext(CGLContextObj context)
{
if (!context)
return kCGLBadContext;
context->priv->lock();
return kCGLNoError;
}
CGLError CGLUnlockContext(CGLContextObj context)
{
if (!context)
return kCGLBadContext;
context->priv->unlock();
return kCGLNoError;
}

View File

@ -1,14 +0,0 @@
#ifndef OPENGL_H
#define OPENGL_H
#include "CGLContext.h"
#include "CGLTypes.h"
extern "C" {
CGLError CGLLockContext(CGLContextObj context);
CGLError CGLUnlockContext(CGLContextObj context);
}
#endif

1
src/external/AppKit vendored

@ -1 +0,0 @@
Subproject commit 630cbd2151f8d3ac715bca27ce71c5e7625b9647

1
src/external/cocotron vendored Submodule

@ -0,0 +1 @@
Subproject commit 581eb57caddc72e2421795380ca8af9b8c09bb2f

@ -1 +0,0 @@
Subproject commit 4fdbcaf767745c95ca528b7e96a66b9bf29303ac