Move to gtk 2.4

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9011 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2004-09-26 16:48:30 +00:00
parent ec94b42f51
commit d86c6d46bb
33 changed files with 164 additions and 172 deletions

View File

@ -1,3 +1,7 @@
2004-09-26 Lars Gullik Bjonnes <larsbj@gullik.net>
* configure.ac: update for gtk 2.4
2004-09-23 Bennett Helm <bennett.helm@fandm.edu>
* README.MacOSX: update again

View File

@ -192,13 +192,13 @@ for frontend in $FRONTENDS ; do
dnl FRONTEND_LIBS="@XPM_LIB@ @XFORMS_LIB@ ${GNOME_FRONTEND_LIBS}"
dnl ;;
gtk)
PKG_CHECK_MODULES(GTK_FRONTEND, gtkmm-2.0 libglademm-2.0)
PKG_CHECK_MODULES(GTK_FRONTEND, gtkmm-2.4 libglademm-2.4)
FRONTENDS_PROGS="$FRONTENDS_PROGS lyx-gtk\$(EXEEXT)"
FRONTENDS_SUBDIRS="$FRONTENDS_SUBDIRS gtk"
RPM_FRONTEND="gtk"
RPM_FRONTEND_DEPS='gtkmm >= 2.2.0'
GTKMM_VERSION=`pkg-config --modversion gtkmm-2.0`
LIBGLADEMM_VERSION=`pkg-config --modversion libglademm-2.0`
RPM_FRONTEND_DEPS='gtkmm >= 2.4.0'
GTKMM_VERSION=`pkg-config --modversion gtkmm-2.4`
LIBGLADEMM_VERSION=`pkg-config --modversion libglademm-2.4`
FRONTEND_INFO="${FRONTEND_INFO}\
GTK Frontend:\n\
libgtkmm version:\t\t${GTKMM_VERSION}\n\

View File

@ -37,8 +37,8 @@ string translateShortcut(string const & str)
void warning_pimpl(string const &, string const & message)
{
Gtk::MessageDialog dlg(Glib::locale_to_utf8(message),
Gtk::MESSAGE_WARNING,
Gtk::BUTTONS_CLOSE, true, true);
true, Gtk::MESSAGE_WARNING,
Gtk::BUTTONS_CLOSE, true);
dlg.run();
}
@ -46,8 +46,8 @@ void warning_pimpl(string const &, string const & message)
void error_pimpl(string const &, string const & message)
{
Gtk::MessageDialog dlg(Glib::locale_to_utf8(message),
Gtk::MESSAGE_ERROR,
Gtk::BUTTONS_CLOSE, true, true);
true, Gtk::MESSAGE_ERROR,
Gtk::BUTTONS_CLOSE, true);
dlg.run();
}
@ -55,8 +55,8 @@ void error_pimpl(string const &, string const & message)
void information_pimpl(string const &, string const & message)
{
Gtk::MessageDialog dlg(Glib::locale_to_utf8(message),
Gtk::MESSAGE_INFO,
Gtk::BUTTONS_CLOSE, true, true);
true, Gtk::MESSAGE_INFO,
Gtk::BUTTONS_CLOSE, true);
dlg.run();
}
@ -71,8 +71,8 @@ int prompt_pimpl(string const &, string const & question,
if (!b3.empty())
gb3 = Glib::locale_to_utf8(translateShortcut(b3));
Gtk::MessageDialog dlg(Glib::locale_to_utf8(question),
Gtk::MESSAGE_QUESTION,
Gtk::BUTTONS_NONE, true, true);
true, Gtk::MESSAGE_QUESTION,
Gtk::BUTTONS_NONE, true);
dlg.add_button(gb1, 0);
dlg.add_button(gb2, 1);
if (!b3.empty())
@ -86,9 +86,9 @@ std::pair<bool, string> const askForText_pimpl(string const & msg,
string const & dflt)
{
Gtk::MessageDialog dlg(Glib::locale_to_utf8(msg),
Gtk::MESSAGE_QUESTION,
true, Gtk::MESSAGE_QUESTION,
Gtk::BUTTONS_OK_CANCEL,
true, true);
true);
Gtk::Entry entry;
entry.set_text(Glib::locale_to_utf8(dflt));
entry.set_position(-1);

View File

@ -1,3 +1,8 @@
2004-09-26 Lars Gullik Bjonnes <larsbj@gullik.net>
John Spray <spray_john@users.sourceforge.net>
* Initial move to gtk 2.4.
2004-09-26 Lars Gullik Bjonnes <larsbj@gullik.net>
* WS changes.

View File

@ -28,9 +28,9 @@ FileDialog::Private::Private(string const & title,
fileSelection_.get_button_area()->children().push_back(
Gtk::Box_Helpers::Element(button2_));
button1_.signal_clicked().connect(
SigC::slot(*this, &FileDialog::Private::onButton1Clicked));
sigc::mem_fun(*this, &FileDialog::Private::onButton1Clicked));
button2_.signal_clicked().connect(
SigC::slot(*this, &FileDialog::Private::onButton2Clicked));
sigc::mem_fun(*this, &FileDialog::Private::onButton2Clicked));
if (!b1.first.empty() && !b1.second.empty()) {
string::size_type pos = b1.first.find('|');
button1_.set_label(

View File

@ -12,10 +12,11 @@
#ifndef FILE_DIALOG_PRIVATE_H
#define FILE_DIALOG_PRIVATE_H
#include <gtkmm.h>
#include "frontends/FileDialog.h"
class FileDialog::Private : public SigC::Object {
#include <gtkmm.h>
class FileDialog::Private : public sigc::trackable {
public:
Private(std::string const & title,
kb_action action,

View File

@ -173,7 +173,7 @@ void GAboutlyx::doBuild()
Gtk::Button * btn;
xml_->get_widget("close_button", btn);
setCancel(btn);
//btn->signal_clicked().connect(SigC::slot(*this, &GViewBase::onCancel));
//btn->signal_clicked().connect(sigc::mem_fun(*this, &GViewBase::onCancel));
}
} // namespace frontend

View File

@ -123,7 +123,7 @@ void GMathDelim::doBuild()
rightSel_ = 1;
xml_->get_widget("Box", box);
delimTbl_.signalClicked().connect(
SigC::slot(*this, &GMathDelim::onDelimTblClicked));
sigc::mem_fun(*this, &GMathDelim::onDelimTblClicked));
delimTbl_.show();
box->children().push_back(
Gtk::Box_Helpers::Element(delimTbl_));
@ -133,11 +133,11 @@ void GMathDelim::doBuild()
bcview().addReadOnly(both_);
bcview().addReadOnly(demo_);
left_->signal_clicked().connect(
SigC::slot(*this, &GMathDelim::onRadioClicked));
sigc::mem_fun(*this, &GMathDelim::onRadioClicked));
right_->signal_clicked().connect(
SigC::slot(*this, &GMathDelim::onRadioClicked));
sigc::mem_fun(*this, &GMathDelim::onRadioClicked));
both_->signal_clicked().connect(
SigC::slot(*this, &GMathDelim::onRadioClicked));
sigc::mem_fun(*this, &GMathDelim::onRadioClicked));
}
@ -147,7 +147,7 @@ void GMathDelim::setDemoPixmap()
pixmap_ = Gdk::Pixmap::create_from_xpm(demo_->get_colormap(),
mask_,
delim0);
image = SigC::manage(new Gtk::Image(pixmap_, mask_));
image = Gtk::manage(new Gtk::Image(pixmap_, mask_));
image->show();
demo_->add(*image);
gcMask_ = Gdk::GC::create(mask_);

View File

@ -114,10 +114,10 @@ void GMathPanel::doBuild()
setCancel(close);
tableUp_.signalClicked().connect(
SigC::slot(*this, &GMathPanel::onTableUpClicked));
sigc::mem_fun(*this, &GMathPanel::onTableUpClicked));
tableUp_.show();
tableDown_.signalClicked().connect(
SigC::slot(*this, &GMathPanel::onTableDownClicked));
sigc::mem_fun(*this, &GMathPanel::onTableDownClicked));
tableDown_.show();
xml_->get_widget("Vbox", vbox);
@ -132,7 +132,7 @@ void GMathPanel::doBuild()
functions_->append_column("Functions", listCol_);
listSel_ = functions_->get_selection();
listSel_->signal_changed().connect(
SigC::slot(*this, &GMathPanel::onFunctionSelected));
sigc::mem_fun(*this, &GMathPanel::onFunctionSelected));
for (int i = 0; i < nr_function_names; ++i)
(*listStore_->append())[listCol_] =
Glib::locale_to_utf8(function_names[i]);

View File

@ -85,7 +85,7 @@ GMenubar::GMenubar(LyXView * lyxView, MenuBackend const & /*menuBackend*/) :
labelTrans(i->label(), i->shortcut()),
*gmenu));
menubar_.items().back().signal_activate().connect(
SigC::bind(SigC::slot(*this, &GMenubar::onSubMenuActivate), &(*i),
sigc::bind(sigc::mem_fun(*this, &GMenubar::onSubMenuActivate), &(*i),
&menubar_.items().back()));
mainMenuNames_.push_back(i->submenuname());
}
@ -173,7 +173,7 @@ void GMenubar::onSubMenuActivate(MenuItem const * item,
labelTrans(i->label(), i->shortcut()),
*gmenu_new));
gmenu->items().back().signal_activate().connect(
SigC::bind(SigC::slot(*this, &GMenubar::onSubMenuActivate),
sigc::bind(sigc::mem_fun(*this, &GMenubar::onSubMenuActivate),
&(*i),
&gmenu->items().back()));
if (submenuDisabled(&(*i)))
@ -206,7 +206,7 @@ void GMenubar::onSubMenuActivate(MenuItem const * item,
}
Gtk::MenuItem & item = gmenu->items().back();
item.signal_activate().connect(
SigC::bind(SigC::slot(*this, &GMenubar::onCommandActivate),
sigc::bind(sigc::mem_fun(*this, &GMenubar::onCommandActivate),
&(*i), &item));
if (!flag.enabled())
item.set_sensitive(false);

View File

@ -21,7 +21,7 @@ class LyXView;
namespace lyx {
namespace frontend {
class GMenubar : public Menubar, public SigC::Object {
class GMenubar : public Menubar, public sigc::trackable {
public:
GMenubar(LyXView *, MenuBackend const &);
~GMenubar();

View File

@ -34,14 +34,14 @@ GMiniBuffer::GMiniBuffer(GView * view, ControlCommandBuffer & control) :
listView_.set_model(listStore_);
listView_.append_column("Completions", listCol_);
listView_.signal_key_press_event().connect(
SigC::slot(*this, &GMiniBuffer::onListKeyPress));
sigc::mem_fun(*this, &GMiniBuffer::onListKeyPress));
listView_.signal_focus_in_event().connect(
SigC::slot(*this, &GMiniBuffer::onListFocusIn));
sigc::mem_fun(*this, &GMiniBuffer::onListFocusIn));
listView_.signal_focus_out_event().connect(
SigC::slot(*this, &GMiniBuffer::onFocusOut));
sigc::mem_fun(*this, &GMiniBuffer::onFocusOut));
listSel_ = listView_.get_selection();
listSel_->signal_changed().connect(
SigC::slot(*this, &GMiniBuffer::onSelected));
sigc::mem_fun(*this, &GMiniBuffer::onSelected));
listView_.show();
scrolledWindow_.set_policy(Gtk::POLICY_AUTOMATIC,
@ -53,13 +53,13 @@ GMiniBuffer::GMiniBuffer(GView * view, ControlCommandBuffer & control) :
Gtk::Box_Helpers::Element(scrolledWindow_,Gtk::PACK_SHRINK));
entry_.signal_key_press_event().connect(
SigC::slot(*this, &GMiniBuffer::onKeyPress));
sigc::mem_fun(*this, &GMiniBuffer::onKeyPress));
entry_.signal_focus_in_event().connect(
SigC::slot(*this, &GMiniBuffer::onFocusIn));
sigc::mem_fun(*this, &GMiniBuffer::onFocusIn));
entry_.signal_focus_out_event().connect(
SigC::slot(*this, &GMiniBuffer::onFocusOut));
sigc::mem_fun(*this, &GMiniBuffer::onFocusOut));
entry_.signal_activate().connect(
SigC::slot(*this, &GMiniBuffer::onCommit));
sigc::mem_fun(*this, &GMiniBuffer::onCommit));
entry_.show();
view_->getBox(GView::Bottom).children().push_back(

View File

@ -20,7 +20,7 @@ namespace frontend {
class ControlCommandBuffer;
class GMiniBuffer : public SigC::Object {
class GMiniBuffer : public sigc::trackable {
public:
GMiniBuffer(GView * view, ControlCommandBuffer & control);
~GMiniBuffer();

View File

@ -15,6 +15,7 @@
#include "frontends/Painter.h"
#include <X11/Xft/Xft.h>
#include <gtkmm.h>
#include <map>

View File

@ -150,22 +150,23 @@ void GPrint::doBuild()
Gtk::Button * apply;
xml_->get_widget("PrintButton", ok);
xml_->get_widget("CancelButton", cancel);
setOK(ok);
setCancel(cancel);
Gtk::Button * browse;
xml_->get_widget("Browse", browse);
browse->signal_clicked().connect(SigC::slot(*this, &GPrint::onBrowse));
browse->signal_clicked().connect(sigc::mem_fun(*this, &GPrint::onBrowse));
fileEntry_->signal_changed().connect(SigC::bind(SigC::slot(*this, &GPrint::onTargetEdit), fileEntry_));
printerEntry_->signal_changed().connect(SigC::bind(SigC::slot(*this, &GPrint::onTargetEdit), printerEntry_));
fromEntry_->signal_changed().connect(SigC::slot(*this, &GPrint::onFromToEdit));
toEntry_->signal_changed().connect(SigC::slot(*this, &GPrint::onFromToEdit));
printer_->signal_toggled().connect(SigC::slot(*this, &GPrint::updateUI));
file_->signal_toggled().connect(SigC::slot(*this, &GPrint::updateUI));
all_->signal_toggled().connect(SigC::slot(*this, &GPrint::updateUI));
fromTo_->signal_toggled().connect(SigC::slot(*this, &GPrint::updateUI));
number_->signal_changed().connect(SigC::slot(*this, &GPrint::updateUI));
fileEntry_->signal_changed().connect(sigc::bind(sigc::mem_fun(*this, &GPrint::onTargetEdit), fileEntry_));
printerEntry_->signal_changed().connect(sigc::bind(sigc::mem_fun(*this, &GPrint::onTargetEdit), printerEntry_));
fromEntry_->signal_changed().connect(sigc::mem_fun(*this, &GPrint::onFromToEdit));
toEntry_->signal_changed().connect(sigc::mem_fun(*this, &GPrint::onFromToEdit));
printer_->signal_toggled().connect(sigc::mem_fun(*this, &GPrint::updateUI));
file_->signal_toggled().connect(sigc::mem_fun(*this, &GPrint::updateUI));
all_->signal_toggled().connect(sigc::mem_fun(*this, &GPrint::updateUI));
fromTo_->signal_toggled().connect(sigc::mem_fun(*this, &GPrint::updateUI));
number_->signal_changed().connect(sigc::mem_fun(*this, &GPrint::updateUI));
controller().initialiseParams("");
update();

View File

@ -48,13 +48,13 @@ void GSearch::doBuild()
xml_->get_widget("SearchBackwards", backwardscheck);
findnextbutton->signal_clicked().connect(
SigC::slot(*this, &GSearch::onFindNext));
sigc::mem_fun(*this, &GSearch::onFindNext));
replacebutton->signal_clicked().connect(
SigC::slot(*this, &GSearch::onReplace));
sigc::mem_fun(*this, &GSearch::onReplace));
replaceallbutton->signal_clicked().connect(
SigC::slot(*this, &GSearch::onReplaceAll));
sigc::mem_fun(*this, &GSearch::onReplaceAll));
findentry->signal_changed().connect(
SigC::slot(*this,&GSearch::onFindEntryChanged));
sigc::mem_fun(*this,&GSearch::onFindEntryChanged));
bcview().addReadOnly(replaceentry);
bcview().addReadOnly(replacebutton);

View File

@ -67,7 +67,7 @@ void GText::doBuild()
setRestore(restore);
bcview().addReadOnly(entry_);
entry_->signal_changed().connect(
SigC::slot(*this, &GText::onEntryChanged));
sigc::mem_fun(*this, &GText::onEntryChanged));
}

View File

@ -51,7 +51,7 @@ void GTimeout::start()
}
conn_ = Glib::signal_timeout().connect(
SigC::slot(*this, &GTimeout::timeoutEvent),
sigc::mem_fun(*this, &GTimeout::timeoutEvent),
timeout_ms()
);
running_ = true;

View File

@ -24,7 +24,7 @@ namespace frontend {
* This class executes the callback when the timeout expires
* using Gtk mechanisms
*/
class GTimeout : public Timeout::Impl, public SigC::Object {
class GTimeout : public Timeout::Impl, public sigc::trackable {
public:
///
GTimeout(Timeout & owner_);
@ -40,8 +40,8 @@ public:
bool timeoutEvent();
private:
/// Timer connection
SigC::Connection conn_;
/// Used for running as SigC::Connection::connected() isn't const
sigc::connection conn_;
/// Used for running as sigc::connection::connected() isn't const
bool running_;
};

View File

@ -79,18 +79,20 @@ GLayoutBox::GLayoutBox(LyXView & owner,
combo_.get_entry()->unset_flags(Gtk::CAN_FOCUS | Gtk::CAN_DEFAULT);
comboClear(combo_);
combo_.get_entry()->signal_changed().connect(
SigC::slot(*this,
&GLayoutBox::selected));
combo_.get_entry()->signal_changed().connect(
sigc::mem_fun(*this,&GLayoutBox::selected));
combo_.show();
toolbar.tools().push_back(Gtk::Toolbar_Helpers::Element(combo_));
toolbar.tools().back().get_widget()->set_data(
combo_.set_data(
gToolData,
reinterpret_cast<void*>(&const_cast<FuncRequest &>(func)));
Gtk::ToolItem * toolitem = Gtk::manage(new Gtk::ToolItem);
toolitem->add(combo_);
toolbar.insert(*toolitem,-1);
}
void GLayoutBox::set(string const & layout)
{
LyXTextClass const & tc = getTextClass(owner_);
@ -188,6 +190,7 @@ GToolbar::GToolbar(ToolbarBackend::Toolbar const & tbb, LyXView & owner)
add(it->first, it->second);
toolbar_.set_toolbar_style(Gtk::TOOLBAR_ICONS);
toolbar_.show_all();
GView::Position const position = getPosition(tbb.flags);
@ -196,51 +199,54 @@ GToolbar::GToolbar(ToolbarBackend::Toolbar const & tbb, LyXView & owner)
owner_.getBox(position).children().push_back(
Gtk::Box_Helpers::Element(toolbar_, Gtk::PACK_SHRINK));
tooltips_.enable();
}
void GToolbar::add(FuncRequest const & func, string const & tooltip)
{
switch (func.action) {
case ToolbarBackend::SEPARATOR:
toolbar_.tools().push_back(Gtk::Toolbar_Helpers::Space());
break;
case ToolbarBackend::MINIBUFFER:
// Not supported yet.
break;
case ToolbarBackend::LAYOUTS:
{
layout_.reset(new GLayoutBox(owner_, toolbar_, func));
break;
switch (func.action) {
case ToolbarBackend::SEPARATOR: {
Gtk::SeparatorToolItem * space =
Gtk::manage(new Gtk::SeparatorToolItem);
toolbar_.insert(*space,-1);
break;
}
default:
case ToolbarBackend::MINIBUFFER:
// Not supported yet.
break;
case ToolbarBackend::LAYOUTS: {
layout_.reset(new GLayoutBox(owner_, toolbar_, func));
break;
}
default: {
Glib::ustring xpmName =
Glib::locale_to_utf8(toolbarbackend.getIcon(func));
Glib::ustring tip = Glib::locale_to_utf8(tooltip);
Gtk::ToolButton * toolbutton;
if (xpmName.size() == 0) {
toolbar_.tools().push_back(
Gtk::Toolbar_Helpers::ButtonElem(
"",
SigC::bind(SigC::slot(*this, &GToolbar::clicked),
FuncRequest(func)),
tip));
toolbutton = Gtk::manage(new Gtk::ToolButton);
} else {
Gtk::Image * image =
Gtk::manage(new Gtk::Image(xpmName));
Gtk::Image * image = Gtk::manage(new Gtk::Image(xpmName));
image->show();
toolbar_.tools().push_back(
Gtk::Toolbar_Helpers::ButtonElem(
"",
*image,
SigC::bind(SigC::slot(*this, &GToolbar::clicked),
FuncRequest(func)),
tip));
toolbutton = Gtk::manage(new Gtk::ToolButton(*image));
}
toolbar_.tools().back().get_content()->set_data(
gToolData,
// This code is putting a function reference into the GObject data field
// named gToolData. That's how we know how to update the status of the
// toolitem later.
toolbutton->set_data(gToolData,
reinterpret_cast<void*>(&const_cast<FuncRequest &>(func)));
tooltips_.set_tip(*toolbutton, tip, tip);
toolbutton->signal_clicked().connect(sigc::bind(sigc::mem_fun(*this,
&GToolbar::clicked), FuncRequest(func)));
toolbar_.insert(*toolbutton,-1);
break;
}
}
}
@ -264,40 +270,17 @@ void GToolbar::show(bool)
void GToolbar::update()
{
Gtk::Toolbar_Helpers::ToolList::iterator it =
toolbar_.tools().begin();
Gtk::Toolbar_Helpers::ToolList::iterator const end =
toolbar_.tools().end();
int items = toolbar_.get_n_items();
for (; it != end; ++it) {
Gtk::Widget * widget;
switch (it->get_type()) {
case Gtk::TOOLBAR_CHILD_WIDGET:
widget = it->get_widget();
break;
case Gtk::TOOLBAR_CHILD_SPACE:
continue;
default:
widget = it->get_content();
for (int i = 0; i < items; ++i) {
Gtk::ToolItem * item = toolbar_.get_nth_item(i);
FuncRequest const * func = reinterpret_cast<FuncRequest *>(
item->get_data(gToolData));
if (func) {
FuncStatus const status = owner_.getLyXFunc().getStatus(*func);
item->set_sensitive(status.enabled());
}
FuncRequest const & func = *reinterpret_cast<FuncRequest *>(
widget->get_data(gToolData));
if (func.action == int(ToolbarBackend::LAYOUTS))
continue;
FuncStatus const status = owner_.getLyXFunc().getStatus(func);
bool sensitive = status.enabled();
widget->set_sensitive(sensitive);
if (it->get_type() != Gtk::TOOLBAR_CHILD_BUTTON)
return;
if (status.onoff(true))
static_cast<Gtk::Button*>(widget)->
set_relief(Gtk::RELIEF_NORMAL);
if (status.onoff(false))
static_cast<Gtk::Button*>(widget)->
set_relief(Gtk::RELIEF_NONE);
}
}

View File

@ -24,7 +24,7 @@ namespace frontend {
class GView;
class GLayoutBox: public LayoutBox, public SigC::Object {
class GLayoutBox: public LayoutBox, public sigc::trackable {
public:
GLayoutBox(LyXView &, Gtk::Toolbar &, FuncRequest const &);
@ -48,7 +48,7 @@ private:
};
class GToolbar : public Toolbar, public SigC::Object {
class GToolbar : public Toolbar, public sigc::trackable {
public:
GToolbar(ToolbarBackend::Toolbar const &, LyXView &);
void add(FuncRequest const & func, std::string const & tooltip);
@ -61,6 +61,7 @@ private:
GView & owner_;
Gtk::Toolbar toolbar_;
Gtk::Tooltips tooltips_;
boost::scoped_ptr<GLayoutBox> layout_;
};

View File

@ -54,9 +54,9 @@ void GUrl::doBuild()
bcview().addReadOnly(htmlType_);
url_->signal_changed().connect(
SigC::slot(*this, &GUrl::onEntryChanged));
sigc::mem_fun(*this, &GUrl::onEntryChanged));
name_->signal_changed().connect(
SigC::slot(*this, &GUrl::onEntryChanged));
sigc::mem_fun(*this, &GUrl::onEntryChanged));
}

View File

@ -91,7 +91,7 @@ GView::GView()
focus_command_buffer.connect(
boost::bind(&GMiniBuffer::editMode, minibuffer_.get()));
view_state_changed.connect(boost::bind(&GView::showViewState, this));
signal_focus_in_event().connect(SigC::slot(*this, &GView::onFocusIn));
signal_focus_in_event().connect(sigc::mem_fun(*this, &GView::onFocusIn));
set_default_size(500, 550);
// Make sure the buttons are disabled if needed.
updateToolbars();

View File

@ -44,7 +44,7 @@ void GViewBase::build()
if (!iconName.empty())
window()->set_icon_from_file(iconName);
window()->signal_delete_event().connect(
SigC::slot(*this, &GViewBase::onDeleteEvent));
sigc::mem_fun(*this, &GViewBase::onDeleteEvent));
window()->set_title(Glib::locale_to_utf8(getTitle()));
}
@ -74,7 +74,7 @@ void GViewBase::setCancel(Gtk::Button * cancel)
{
bcview().setCancel(cancel);
cancel->signal_clicked().connect(
SigC::slot(*this, &GViewBase::onCancel));
sigc::mem_fun(*this, &GViewBase::onCancel));
}
@ -82,7 +82,7 @@ void GViewBase::setApply(Gtk::Button * apply)
{
bcview().setApply(apply);
apply->signal_clicked().connect(
SigC::slot(*this, &GViewBase::onApply));
sigc::mem_fun(*this, &GViewBase::onApply));
}
@ -90,7 +90,7 @@ void GViewBase::setOK(Gtk::Button * ok)
{
bcview().setOK(ok);
ok->signal_clicked().connect(
SigC::slot(*this, &GViewBase::onOK));
sigc::mem_fun(*this, &GViewBase::onOK));
}
@ -98,7 +98,7 @@ void GViewBase::setRestore(Gtk::Button * restore)
{
bcview().setRestore(restore);
restore->signal_clicked().connect(
SigC::slot(*this, &GViewBase::onRestore));
sigc::mem_fun(*this, &GViewBase::onRestore));
}

View File

@ -22,7 +22,7 @@
namespace lyx {
namespace frontend {
class GViewBase : public Dialog::View, public SigC::Object {
class GViewBase : public Dialog::View, public sigc::trackable {
public:
GViewBase(Dialog &, std::string const &, bool allowResize);
virtual ~GViewBase();
@ -84,8 +84,7 @@ const Gtk::Window * GViewDB<Dialog>::window() const
}
class GViewGladeB : public GViewBase
{
class GViewGladeB : public GViewBase {
protected:
GViewGladeB(Dialog & parent, std::string const & t, bool allowResize);
virtual Gtk::Window const * window() const;

View File

@ -160,22 +160,22 @@ GWorkArea::GWorkArea(LyXView & owner, int width, int height)
Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK |
Gdk::KEY_PRESS_MASK | Gdk::BUTTON1_MOTION_MASK);
workArea_.signal_expose_event().connect(
SigC::slot(*this, &GWorkArea::onExpose));
sigc::mem_fun(*this, &GWorkArea::onExpose));
workArea_.signal_configure_event().connect(
SigC::slot(*this, &GWorkArea::onConfigure));
sigc::mem_fun(*this, &GWorkArea::onConfigure));
workArea_.signal_button_press_event().connect(
SigC::slot(*this, &GWorkArea::onButtonPress));
sigc::mem_fun(*this, &GWorkArea::onButtonPress));
workArea_.signal_button_release_event().connect(
SigC::slot(*this, &GWorkArea::onButtonRelease));
sigc::mem_fun(*this, &GWorkArea::onButtonRelease));
workArea_.signal_key_press_event().connect(
SigC::slot(*this, &GWorkArea::onKeyPress));
sigc::mem_fun(*this, &GWorkArea::onKeyPress));
workArea_.signal_motion_notify_event().connect(
SigC::slot(*this, &GWorkArea::onMotionNotify));
sigc::mem_fun(*this, &GWorkArea::onMotionNotify));
workArea_.show();
vscrollbar_.get_adjustment()->signal_value_changed().connect(
SigC::slot(*this, &GWorkArea::onScroll));
sigc::mem_fun(*this, &GWorkArea::onScroll));
workArea_.signal_scroll_event().connect(
SigC::slot(*this, &GWorkArea::onScrollWheel));
sigc::mem_fun(*this, &GWorkArea::onScrollWheel));
vscrollbar_.show();
hbox_.children().push_back(Gtk::Box_Helpers::Element(workArea_));
hbox_.children().push_back(
@ -469,9 +469,9 @@ void GWorkArea::haveSelection(bool toHave) const
std::vector<Gtk::TargetEntry> listTargets;
listTargets.push_back(Gtk::TargetEntry("UTF8_STRING"));
clipboard->set(listTargets,
SigC::slot(const_cast<GWorkArea&>(*this),
sigc::mem_fun(const_cast<GWorkArea&>(*this),
&GWorkArea::onClipboardGet),
SigC::slot(const_cast<GWorkArea&>(*this),
sigc::mem_fun(const_cast<GWorkArea&>(*this),
&GWorkArea::onClipboardClear));
}
}

View File

@ -55,7 +55,7 @@ private:
};
class GWorkArea : public WorkArea, public SigC::Object {
class GWorkArea : public WorkArea, public sigc::trackable {
public:
GWorkArea(LyXView & owner, int width, int height);
~GWorkArea();

View File

@ -23,7 +23,7 @@ void GXpmBtnTbl::GXpmBtn::setXpm(XpmData xpm)
pixmap_ = Gdk::Pixmap::create_from_xpm(clrmap,
mask_,
xpm);
Gtk::Image * image = SigC::manage(new Gtk::Image(pixmap_, mask_));
Gtk::Image * image = Gtk::manage(new Gtk::Image(pixmap_, mask_));
image->show();
add(*image);
}
@ -34,7 +34,8 @@ void GXpmBtnTbl::GXpmBtn::setXpm(Glib::RefPtr<Gdk::Pixmap> pixmap,
{
pixmap_ = pixmap;
mask_ = mask;
Gtk::Image * image = SigC::manage(new Gtk::Image(pixmap_, mask_));
Gtk::Image * image =
Gtk::manage(new Gtk::Image(pixmap_, mask_));
image->show();
add(*image);
}
@ -74,7 +75,7 @@ void GXpmBtnTbl::construct()
GXpmBtn * btn = &btns_[index(row, col)];
btn->setRow(row);
btn->setCol(col);
btn->signalClicked().connect(signalClicked_.slot());
btn->signalClicked().connect(signalClicked_);
btn->show();
attach(*btn, col, col + 1, row, row + 1);
}
@ -162,15 +163,12 @@ void GXpmBtnTbl::on_realize()
void buttonSetXpm(Gtk::Button * btn, char const ** xpm)
{
Glib::RefPtr<Gdk::Bitmap> mask;
Glib::RefPtr<Gdk::Colormap> clrmap = btn->get_colormap();
Glib::RefPtr<Gdk::Bitmap> mask;
Glib::RefPtr<Gdk::Pixmap> pixmap =
Gdk::Pixmap::create_from_xpm(clrmap,
mask,
xpm);
Gtk::Image * image = SigC::manage(new Gtk::Image(pixmap, mask));
Gdk::Pixmap::create_from_xpm(clrmap, mask, xpm);
Gtk::Image * image = Gtk::manage(new Gtk::Image(pixmap, mask));
image->show();
btn->add(*image);
}

View File

@ -12,14 +12,14 @@
#ifndef XPM_BTN_TBL_H
#define XPM_BTN_TBL_H
#include <boost/scoped_array.hpp>
#include <gtkmm.h>
#include <boost/scoped_array.hpp>
class GXpmBtnTbl : public Gtk::Table {
public:
typedef char const ** XpmData;
typedef SigC::Signal2<void, int, int> SigType;
typedef sigc::signal<void, int, int> SigType;
struct XbmData {
unsigned char const* data_;
int width_;
@ -31,8 +31,7 @@ public:
public:
GXpmBtn() : row_(-1), col_(-1)
{
signal_clicked().connect(
SigC::slot(*this,
signal_clicked().connect(sigc::mem_fun(*this,
&GXpmBtn::onButtonClicked));
}
void setRow(int row) { row_ = row; }
@ -79,7 +78,7 @@ private:
int rows_;
int cols_;
boost::scoped_array<GXpmBtn> btns_;
const XbmData * xbm_;
XbmData const * xbm_;
SigType signalClicked_;
};

View File

@ -10,12 +10,12 @@
#include <config.h>
#include <gtkmm.h>
#include "frontends/LyXScreenFactory.h"
#include "GWorkArea.h"
#include "GScreen.h"
#include "frontends/LyXScreenFactory.h"
#include <gtkmm.h>
namespace LyXScreenFactory {

View File

@ -18,7 +18,7 @@ io_callback::io_callback(int fd, boost::function<void()> func)
: func_(func)
{
conn_ = Glib::signal_io().connect(
SigC::slot(*this, &io_callback::data_received),
sigc::mem_fun(*this, &io_callback::data_received),
fd, Glib::IO_IN);
}

View File

@ -26,14 +26,14 @@
* connected/read.
*
*/
class io_callback : public SigC::Object {
class io_callback : public sigc::trackable {
public:
/// connect a connection notification from the LyXServerSocket
io_callback(int fd, boost::function<void()> func);
private:
bool data_received(Glib::IOCondition);
/// our notifier
SigC::Connection conn_;
sigc::connection conn_;
/// The callback function
boost::function<void()> func_;
};

View File

@ -10,6 +10,7 @@
#include <config.h>
#include <gtkmm.h>
#include "xftFontLoader.h"
#include "FontInfo.h"
#include "gettext.h"
@ -24,7 +25,6 @@
#include "support/systemcall.h"
#include "support/filetools.h"
#include <gtkmm.h>
#include <X11/Xft/Xft.h>