Skip to content
Snippets Groups Projects
Commit 21cc635c authored by stefan's avatar stefan
Browse files

New sip exports for ToolOptionsWin

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2085 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent 7f5fff53
No related branches found
No related tags found
No related merge requests found
......@@ -33,7 +33,6 @@ using namespace boost::python;
#include "transfer_ownership.hh"
#include "sip_handler.hh"
#include "tool_options_win_proxy.hh"
#if OST_IMG_ENABLED
#include "data_viewer_proxy.hh"
using namespace ost::img::gui;
......@@ -44,11 +43,6 @@ using namespace ost::gui;
namespace {
ToolOptionsWinProxy app_get_tool_options_win(GostyApp* app)
{
return ToolOptionsWinProxy(app->GetToolOptionsWin());
}
#if OST_IMG_ENABLED
DataViewerProxyPtr app_create_data_viewer1(GostyApp* app, const ost::img::Data& d, const QString& name)
{
......@@ -101,8 +95,10 @@ void export_Gosty()
return_value_policy<reference_existing_object>())
.add_property("seq_viewer", make_function(&GostyApp::GetSequenceViewer,
return_value_policy<reference_existing_object>()))
.def("GetToolOptionsWin", &app_get_tool_options_win)
.add_property("tool_options_win", &app_get_tool_options_win)
.def("GetToolOptionsWin", &GostyApp::GetToolOptionsWin,
return_value_policy<reference_existing_object>())
.add_property("tool_options_win", make_function(&GostyApp::GetToolOptionsWin,
return_value_policy<reference_existing_object>()))
#if OST_IMG_ENABLED
.def("CreateDataViewer", &app_create_data_viewer1)
.def("CreateDataViewer", &app_create_data_viewer2)
......
......@@ -23,14 +23,13 @@
#include <boost/python/register_ptr_to_python.hpp>
#include <boost/python/suite/indexing/vector_indexing_suite.hpp>
#include <iostream>
using namespace boost::python;
#include <ost/gui/tools/tool.hh>
#include <ost/gui/tools/tool_manager.hh>
#include "tool_options_win_proxy.hh"
#include <ost/gui/tools/tool_options_win.hh>
#include "sip_handler.hh"
#include "qptr.hh"
using namespace boost::python;
using namespace ost::gui;
using namespace ost;
......@@ -246,9 +245,11 @@ void export_Tool()
.def("FindToolByName", &ToolManager::FindToolByName,
return_value_policy<reference_existing_object>())
;
class_<ToolOptionsWinProxy, bases<SipHandlerBase> >("ToolOptionsWin")
.def("Show", &ToolOptionsWinProxy::Show)
.def("Hide", &ToolOptionsWinProxy::Hide)
class_<ToolOptionsWin, boost::noncopyable>("ToolOptionsWin", no_init)
.def("Show", &ToolOptionsWin::show)
.def("Hide", &ToolOptionsWin::hide)
.def("GetQObject",&get_py_qobject<ToolOptionsWin>)
.add_property("qobject", &get_py_qobject<ToolOptionsWin>)
;
class_<gfx::NodePtrList>("NodePtrList", init<>())
......
......@@ -39,7 +39,7 @@ class InspectorWidget(ToolBarOptionsWidget):
[InspectorWidget.ICONS_PATH+"render_icon.png",RenderOptionsWidget(self),None],
[InspectorWidget.ICONS_PATH+"color_icon.png",ColorOptionsWidget(self),None],
[InspectorWidget.ICONS_PATH+"preset_icon.png", PresetWidget(self),None],
[InspectorWidget.ICONS_PATH+"tool_icon.png",sip.wrapinstance(app.GetToolOptionsWin().GetSipHandle(),QtGui.QWidget),"Tool Options"]
[InspectorWidget.ICONS_PATH+"tool_icon.png",app.tool_options_win.qobject,"Tool Options"]
]
for o in options:
ToolBarOptionsWidget.AddWidget(self,o[0], o[1], o[2])
......
//------------------------------------------------------------------------------
// This file is part of the OpenStructure project <www.openstructure.org>
//
// Copyright (C) 2008-2010 by the OpenStructure authors
//
// 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 3.0 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; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//------------------------------------------------------------------------------
#ifndef OST_GUI_TOOL_OPTIONS_WIN_PROXY_HH
#define OST_GUI_TOOL_OPTIONS_WIN_PROXY_HH
#include <ost/gui/tools/tool_options_win.hh>
#include "sip_handler.hh"
namespace ost { namespace gui {
class ToolOptionsWinProxy : public SipHandler<ToolOptionsWin> {
public:
ToolOptionsWinProxy(ToolOptionsWin* gl_win=NULL):
SipHandler<ToolOptionsWin>(gl_win)
{ }
void Show()
{
return Me()->show();
}
void Hide()
{
return Me()->hide();
}
};
}}
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment