Skip to content

Commit

Permalink
Merge branch 'core4' into feature/add-target-component-alias
Browse files Browse the repository at this point in the history
  • Loading branch information
zerotacg committed Aug 28, 2024
2 parents 628d811 + ab65885 commit d4ca4da
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 117 deletions.
2 changes: 1 addition & 1 deletion nel/tools/3d/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ IF(WITH_NEL_TOOLS AND WITH_3D)

IF(WITH_QT OR WITH_QT5)
ADD_SUBDIRECTORY(tile_edit_qt)
ADD_SUBDIRECTORY(object_viewer_widget)
ENDIF()

IF(WITH_QT5)
ADD_SUBDIRECTORY(object_viewer_widget)
ADD_SUBDIRECTORY(shared_widgets)
ADD_SUBDIRECTORY(panoply_preview)
ENDIF()
Expand Down
2 changes: 1 addition & 1 deletion nel/tools/3d/object_viewer_widget/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#-----------------------------------------------------------------------------
#
# Object Viewer Widget
# Copyright (C) 2010 Adrian Jäkel <aj at elane2k dot com>
# Copyright (C) 2010 Adrian Jäkel <aj at elane2k dot com>
#
#-----------------------------------------------------------------------------

Expand Down
39 changes: 8 additions & 31 deletions nel/tools/3d/object_viewer_widget/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,43 +1,20 @@
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${NEL_INCLUDE_DIR})

FILE(GLOB OBJECT_VIEWER_WIDGET_SRC *.cpp *.h)
SET(OBJECT_VIEWER_WIDGET_HDR object_viewer_widget.h)

IF(WITH_QT)
INCLUDE_DIRECTORIES(${QT_INCLUDES})
INCLUDE(${QT_USE_FILE})

SET(QT_USE_QTGUI TRUE)
SET(QT_USE_QTOPENGL TRUE)

QT4_WRAP_CPP(OBJECT_VIEWER_WIDGET_MOC_SRCS ${OBJECT_VIEWER_WIDGET_HDR})

ADD_DEFINITIONS(${QT_DEFINITIONS})
ADD_DEFINITIONS(-DQT_NO_KEYWORDS)
ADD_DEFINITIONS(-DQT_PLUGIN)
ADD_DEFINITIONS(-DQT_SHARED)
#ADD_DEFINITIONS(-DQT_NO_DEBUG)

SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_QTOPENGL_LIBRARY})
ELSE()
QT5_WRAP_CPP(OBJECT_VIEWER_WIDGET_MOC_SRCS ${OBJECT_VIEWER_WIDGET_HDR})
ENDIF()
QT5_WRAP_CPP(OBJECT_VIEWER_WIDGET_MOC_SRCS ${OBJECT_VIEWER_WIDGET_HDR})

SOURCE_GROUP(QtGeneratedMocSrc FILES ${OBJECT_VIEWER_WIDGET_MOC_SRCS})

IF(WITH_STATIC)
SET(TYPE STATIC)
ELSE()
SET(TYPE MODULE)
ENDIF()

ADD_LIBRARY(object_viewer_widget_qt ${TYPE}
ADD_LIBRARY(object_viewer_widget_qt MODULE
${OBJECT_VIEWER_WIDGET_SRC}
${OBJECT_VIEWER_WIDGET_MOC_SRCS})

TARGET_INCLUDE_DIRECTORIES(object_viewer_widget_qt
PUBLIC
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${NEL_INCLUDE_DIR})

TARGET_LINK_LIBRARIES(object_viewer_widget_qt
NeL::misc
NeL::3d
Expand Down
3 changes: 2 additions & 1 deletion nel/tools/3d/object_viewer_widget/src/interfaces.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ namespace NLQT

} /* namespace NLQT */

Q_DECLARE_INTERFACE(NLQT::IObjectViewer,"com.ryzom.dev.IObjectViewer/0.1")
#define IObjectViewer_iid "com.ryzom.dev.IObjectViewer/0.1"
Q_DECLARE_INTERFACE(NLQT::IObjectViewer,IObjectViewer_iid)

#endif
4 changes: 4 additions & 0 deletions nel/tools/3d/object_viewer_widget/src/object_viewer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"Name" : "Object Viewer",
"Version" : "0.0.1"
}
65 changes: 0 additions & 65 deletions nel/tools/3d/object_viewer_widget/src/object_viewer_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

// Project includes

#ifndef USE_QT5
Q_EXPORT_PLUGIN2(object_viewer_widget_qt, NLQT::CObjectViewerWidget)
#endif

#if defined(NL_OS_WINDOWS)
typedef bool (*winProc)(NL3D::IDriver *driver, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
#elif defined(NL_OS_MAC)
Expand Down Expand Up @@ -743,8 +739,6 @@ namespace NLQT
_Scene->animate ( fdelta);
}

#ifdef USE_QT5

bool CObjectViewerWidget::nativeEvent(const QByteArray &eventType, void *message, long *result)
{
if (getDriver() && getDriver()->isActive())
Expand All @@ -770,63 +764,4 @@ namespace NLQT
return false;
}

#else

#if defined(NL_OS_WINDOWS)

bool CObjectViewerWidget::winEvent(MSG *message, long *result)
{
if (getDriver() && getDriver()->isActive())
{
NL3D::IDriver *driver = dynamic_cast<NL3D::CDriverUser*>(getDriver())->getDriver();
if (driver)
{
winProc proc = (winProc)driver->getWindowProc();
return proc(driver, message->hwnd, message->message, message->wParam, message->lParam);
}
}

return false;
}

#elif defined(NL_OS_MAC)

bool CObjectViewerWidget::macEvent(EventHandlerCallRef caller, EventRef event)
{
if(caller)
nlerror("You are using QtCarbon! Only QtCocoa supported, please upgrade Qt");

if (getDriver() && getDriver()->isActive())
{
NL3D::IDriver *driver = dynamic_cast<NL3D::CDriverUser*>(getDriver())->getDriver();
if (driver)
{
cocoaProc proc = (cocoaProc)driver->getWindowProc();
return proc(driver, event);
}
}

return false;
}

#elif defined(NL_OS_UNIX)

bool CObjectViewerWidget::x11Event(XEvent *event)
{
if (getDriver() && getDriver()->isActive())
{
NL3D::IDriver *driver = dynamic_cast<NL3D::CDriverUser*>(getDriver())->getDriver();
if (driver)
{
x11Proc proc = (x11Proc)driver->getWindowProc();
return proc(driver, event);
}
}

return false;
}
#endif

#endif

} /* namespace NLQT */
13 changes: 1 addition & 12 deletions nel/tools/3d/object_viewer_widget/src/object_viewer_widget.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ namespace NLQT
public IObjectViewer
{
Q_OBJECT
Q_PLUGIN_METADATA(IID IObjectViewer_iid FILE "object_viewer.json")
Q_INTERFACES(NLQT::IObjectViewer)

public:
Expand Down Expand Up @@ -166,19 +167,7 @@ namespace NLQT
virtual QString name() const {return ("ObjectViewerWidget");}

protected:
#ifdef USE_QT5
virtual bool nativeEvent(const QByteArray &eventType, void *message, long *result);
#else

#if defined(NL_OS_WINDOWS)
virtual bool winEvent(MSG * message, long * result);
#elif defined(NL_OS_MAC)
virtual bool macEvent(EventHandlerCallRef caller, EventRef event);
#elif defined(NL_OS_UNIX)
virtual bool x11Event(XEvent *event);
#endif

#endif

private Q_SLOTS:
void updateRender();
Expand Down
6 changes: 0 additions & 6 deletions nel/tools/3d/object_viewer_widget/src/stdpch.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QtCore/QtCore>
#include <QtGui/QtGui>

#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
#define USE_QT5
#endif

#ifdef USE_QT5
#include <QtWidgets/QtWidgets>
#include <QtConcurrent/QtConcurrent>
#endif

#include <map>
#include <memory>
Expand Down
1 change: 1 addition & 0 deletions snowballs2/client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ INSTALL(DIRECTORY data/
COMPONENT snowballsdata
PATTERN "CVS" EXCLUDE
PATTERN ".svn" EXCLUDE
PATTERN ".gitkeep" EXCLUDE
PATTERN "Makefile*" EXCLUDE)

0 comments on commit d4ca4da

Please sign in to comment.