diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-10-17 20:34:29 (EDT) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-10-17 20:34:29 (EDT) |
commit | f885e9dece74ce168121187ecef63a2d6b58cdec (patch) | |
tree | 284765ce2944103d058449670e15fe8488436e9a /src | |
parent | 93f6601999c331c357b275f947494299c6617d5b (diff) | |
download | marquee-f885e9dece74ce168121187ecef63a2d6b58cdec.zip marquee-f885e9dece74ce168121187ecef63a2d6b58cdec.tar.gz marquee-f885e9dece74ce168121187ecef63a2d6b58cdec.tar.bz2 |
MqTab: Expose update_positions() as non-static function
Diffstat (limited to 'src')
-rw-r--r-- | src/tab.c | 38 | ||||
-rw-r--r-- | src/tab.h | 3 |
2 files changed, 22 insertions, 19 deletions
@@ -32,23 +32,6 @@ #include "web-view.h" static void -update_positions(MqTab *node, gint step) -{ - if (node) { - node->position += step; - if (node->tab) { - mq_tab_label_set_position(MQ_TAB_LABEL(node->tab), - node->position); - } - if (node->next) { - update_positions(node->next, step); - } else if (node->parent && node->parent->next) { - update_positions(node->parent->next, step); - } - } -} - -static void update_tree_sizes(MqTab *node, guint step) { if (node) { @@ -74,7 +57,7 @@ append_child(MqTab *new_node, MqTab *parent) parent->first_child = new_node; } parent->last_child = new_node; - update_positions(new_node, 1); + mq_tab_update_positions(new_node, 1); update_tree_sizes(new_node, 1); } @@ -92,7 +75,7 @@ append_sibling(MqTab *new_node, MqTab *prev_sibling) prev_sibling->next->prev = new_node; } prev_sibling->next = new_node; - update_positions(new_node, 1); + mq_tab_update_positions(new_node, 1); update_tree_sizes(new_node, 1); } @@ -220,6 +203,23 @@ mq_tab_get_window(MqTab *tab) } void +mq_tab_update_positions(MqTab *node, gint step) +{ + if (node) { + node->position += step; + if (node->tab) { + mq_tab_label_set_position(MQ_TAB_LABEL(node->tab), + node->position); + } + if (node->next) { + mq_tab_update_positions(node->next, step); + } else if (node->parent && node->parent->next) { + mq_tab_update_positions(node->parent->next, step); + } + } +} + +void mq_tab_update_position(MqTab *tab, guint position) { tab->position = position; @@ -69,6 +69,9 @@ MqWindow * mq_tab_get_window(MqTab *tab); void +mq_tab_update_positions(MqTab *node, gint step); + +void mq_tab_update_position(MqTab *tab, guint position); guint |