Browse Source

drop sigc dependency

CPP-GTK4
yggverse 3 months ago
parent
commit
626997af14
  1. 102
      src/app/browser.cpp
  2. 10
      src/app/browser.hpp
  3. 11
      src/app/browser/main/tab.cpp
  4. 1
      src/app/browser/main/tab.hpp
  5. 10
      src/app/browser/main/tab/label.cpp
  6. 1
      src/app/browser/main/tab/label.hpp
  7. 8
      src/app/browser/main/tab/page/navbar.cpp
  8. 1
      src/app/browser/main/tab/page/navbar.hpp
  9. 8
      src/main.cpp

102
src/app/browser.cpp

@ -35,108 +35,68 @@ Browser::Browser( @@ -35,108 +35,68 @@ Browser::Browser(
// Init actions
add_action(
"tab_append",
sigc::mem_fun(
* this,
& Browser::main_tab_append
)
[this]
{
main->tab_append();
}
);
add_action(
"tab_update",
sigc::mem_fun(
*this,
&Browser::main_tab_update
)
[this]
{
main->tab_update();
}
);
// Close
add_action(
"tab_close",
sigc::mem_fun(
* this,
& Browser::main_tab_close
)
[this]
{
main->tab_close();
}
);
// Close submenu
add_action(
"tab_close_left",
sigc::mem_fun(
* this,
& Browser::main_tab_close_left
)
[this]
{
main->tab_close_left();
}
);
add_action(
"tab_close_right",
sigc::mem_fun(
* this,
& Browser::main_tab_close_right
)
[this]
{
main->tab_close_right();
}
);
add_action(
"tab_close_all",
sigc::mem_fun(
* this,
& Browser::main_tab_close_all
)
[this]
{
main->tab_close_all();
}
);
// Tool
add_action(
"debug",
sigc::mem_fun(
* this,
& Browser::debug
)
[this]
{
gtk_window_set_interactive_debugging(
true
);
}
);
}
Browser::~Browser()
{
destroy();
delete header;
header = nullptr;
delete main;
main = nullptr;
}
void Browser::main_tab_append()
{
main->tab_append();
};
void Browser::main_tab_update()
{
main->tab_update();
};
void Browser::main_tab_close()
{
main->tab_close();
};
void Browser::main_tab_close_left()
{
main->tab_close_left();
};
void Browser::main_tab_close_right()
{
main->tab_close_right();
};
void Browser::main_tab_close_all()
{
main->tab_close_all();
};
void Browser::debug()
{
gtk_window_set_interactive_debugging(
true
);
};
}

10
src/app/browser.hpp

@ -32,16 +32,6 @@ namespace app @@ -32,16 +32,6 @@ namespace app
);
~Browser();
void main_tab_append();
void main_tab_update();
void main_tab_close();
void main_tab_close_left();
void main_tab_close_right();
void main_tab_close_all();
void debug();
};
}

11
src/app/browser/main/tab.cpp

@ -13,10 +13,13 @@ Tab::Tab() @@ -13,10 +13,13 @@ Tab::Tab()
// Init events
signal_switch_page().connect(
sigc::mem_fun(
* this,
& Tab::on_switch
)
[this](Gtk::Widget * page, guint page_num)
{
on_switch(
page,
page_num
);
}
);
}

1
src/app/browser/main/tab.hpp

@ -4,7 +4,6 @@ @@ -4,7 +4,6 @@
#include <glibmm/i18n.h>
#include <gtkmm/widget.h>
#include <gtkmm/notebook.h>
#include <sigc++/functors/mem_fun.h>
namespace app::browser::main
{

10
src/app/browser/main/tab/label.cpp

@ -17,10 +17,12 @@ Label::Label() @@ -17,10 +17,12 @@ Label::Label()
);*/
controller->signal_pressed().connect(
sigc::mem_fun(
* this,
& Label::on_click
)
[this](int n, double x, double y)
{
on_click(
n, x, y
);
}
);
add_controller(

1
src/app/browser/main/tab/label.hpp

@ -5,7 +5,6 @@ @@ -5,7 +5,6 @@
#include <glibmm/refptr.h>
#include <gtkmm/gestureclick.h>
#include <gtkmm/label.h>
#include <sigc++/functors/mem_fun.h>
namespace app::browser::main::tab
{

8
src/app/browser/main/tab/page/navbar.cpp

@ -71,10 +71,10 @@ Navbar::Navbar() @@ -71,10 +71,10 @@ Navbar::Navbar()
// Define group actions
action_group->add_action(
"refresh",
sigc::mem_fun(
* this,
& Navbar::refresh
)
[this]
{
refresh();
}
);
insert_action_group(

1
src/app/browser/main/tab/page/navbar.hpp

@ -5,7 +5,6 @@ @@ -5,7 +5,6 @@
#include <glibmm/refptr.h>
#include <glibmm/ustring.h>
#include <gtkmm/box.h>
#include <sigc++/functors/mem_fun.h>
#include <string>
namespace app::browser::main::tab::page

8
src/main.cpp

@ -20,10 +20,10 @@ int main( @@ -20,10 +20,10 @@ int main(
app->add_action(
"quit",
sigc::mem_fun(
* app,
& Gtk::Application::quit
)
[app]
{
app->quit();
}
);
// Init accels @TODO db settings

Loading…
Cancel
Save