diff options
author | 2011-06-17 23:20:45 +0200 | |
---|---|---|
committer | 2011-06-17 23:20:45 +0200 | |
commit | fe1790fd889dfacc6e4f4a32bfebe29789d5a9ed (patch) | |
tree | b6e23533f7aeeedba4e587487c9611fed4952d6c /plugins | |
parent | 081386fa03e82ca64aa14a5bd5e8bd3ba8b2ba9a (diff) |
initial work to add customizable layout support:
defined data structures, few stubs, many regressions, implemented tabbed playlist widget;
now it should be possible to have several playlist viewers visible at the same time;
playlist keyboard handling is partially broken
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/gtkui/Makefile.am | 3 | ||||
-rw-r--r-- | plugins/gtkui/callbacks.c | 51 | ||||
-rw-r--r-- | plugins/gtkui/callbacks.h | 4 | ||||
-rw-r--r-- | plugins/gtkui/ddbtabstrip.c | 21 | ||||
-rw-r--r-- | plugins/gtkui/deadbeef.glade | 83 | ||||
-rw-r--r-- | plugins/gtkui/fileman.c | 16 | ||||
-rw-r--r-- | plugins/gtkui/gtkui.c | 151 | ||||
-rw-r--r-- | plugins/gtkui/gtkui.h | 7 | ||||
-rw-r--r-- | plugins/gtkui/gtkui_api.h | 13 | ||||
-rw-r--r-- | plugins/gtkui/interface.c | 130 | ||||
-rw-r--r-- | plugins/gtkui/mainplaylist.c | 5 | ||||
-rw-r--r-- | plugins/gtkui/mainplaylist.h | 5 | ||||
-rw-r--r-- | plugins/gtkui/prefwin.c | 30 | ||||
-rw-r--r-- | plugins/gtkui/widgets.c | 306 | ||||
-rw-r--r-- | plugins/gtkui/widgets.h | 44 |
15 files changed, 577 insertions, 292 deletions
diff --git a/plugins/gtkui/Makefile.am b/plugins/gtkui/Makefile.am index 329f14b2..7c82d4e5 100644 --- a/plugins/gtkui/Makefile.am +++ b/plugins/gtkui/Makefile.am @@ -36,7 +36,8 @@ GTKUI_SOURCES = gtkui.c gtkui.h\ dspconfig.c dspconfig.h\ tagwritersettings.c tagwritersettings.h\ wingeom.c wingeom.h\ - pluginconf.h + pluginconf.h\ + widgets.c widgets.h sdkdir = $(pkgincludedir) sdk_HEADERS = gtkui_api.h diff --git a/plugins/gtkui/callbacks.c b/plugins/gtkui/callbacks.c index 4fdc73c3..1c905992 100644 --- a/plugins/gtkui/callbacks.c +++ b/plugins/gtkui/callbacks.c @@ -282,9 +282,8 @@ on_select_all1_activate (GtkMenuItem *menuitem, gpointer user_data) { deadbeef->pl_select_all (); - DdbListview *pl = DDB_LISTVIEW (lookup_widget (mainwin, "playlist")); - ddb_listview_refresh (pl, DDB_REFRESH_LIST); - pl = DDB_LISTVIEW (lookup_widget (searchwin, "searchlist")); + deadbeef->sendmessage (DB_EV_PLAYLISTCHANGED, 0, 0, 0); + DdbListview *pl = DDB_LISTVIEW (lookup_widget (searchwin, "searchlist")); if (pl) { ddb_listview_refresh (pl, DDB_REFRESH_LIST); } @@ -359,7 +358,7 @@ on_mainwin_key_press_event (GtkWidget *widget, } } else { - ddb_listview_handle_keypress (DDB_LISTVIEW (lookup_widget (mainwin, "playlist")), event->keyval, event->state); +// FIXME! ddb_listview_handle_keypress (DDB_LISTVIEW (lookup_widget (mainwin, "playlist")), event->keyval, event->state); } return FALSE; } @@ -837,6 +836,8 @@ void on_toggle_column_headers_activate (GtkMenuItem *menuitem, gpointer user_data) { + // FIXME! + return; GtkWidget *playlist = lookup_widget (mainwin, "playlist"); if (playlist) { if (!gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (menuitem))) { @@ -902,6 +903,8 @@ void on_toggle_tabs (GtkMenuItem *menuitem, gpointer user_data) { + // FIXME! + return; GtkWidget *ts = lookup_widget (mainwin, "tabstrip"); if (!gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (menuitem))) { deadbeef->conf_set_int ("gtkui.tabs.visible", 0); @@ -945,9 +948,8 @@ on_deselect_all1_activate (GtkMenuItem *menuitem, it = next; } deadbeef->pl_unlock (); - DdbListview *pl = DDB_LISTVIEW (lookup_widget (mainwin, "playlist")); - ddb_listview_refresh (pl, DDB_REFRESH_LIST); - pl = DDB_LISTVIEW (lookup_widget (searchwin, "searchlist")); + deadbeef->sendmessage (DB_EV_PLAYLISTCHANGED, 0, 0, 0); + DdbListview *pl = DDB_LISTVIEW (lookup_widget (searchwin, "searchlist")); if (pl) { ddb_listview_refresh (pl, DDB_REFRESH_LIST); } @@ -972,8 +974,7 @@ on_invert_selection1_activate (GtkMenuItem *menuitem, it = next; } deadbeef->pl_unlock (); - DdbListview *pl = DDB_LISTVIEW (lookup_widget (mainwin, "playlist")); - ddb_listview_refresh (pl, DDB_REFRESH_LIST); + deadbeef->sendmessage (DB_EV_PLAYLISTCHANGED, 0, 0, 0); } @@ -1132,9 +1133,7 @@ on_sort_by_title_activate (GtkMenuItem *menuitem, deadbeef->plt_sort (plt, PL_MAIN, -1, "%t", 1); deadbeef->plt_unref (plt); - DdbListview *pl = DDB_LISTVIEW (lookup_widget (mainwin, "playlist")); - ddb_listview_clear_sort (pl); - ddb_listview_refresh (pl, DDB_REFRESH_LIST | DDB_LIST_CHANGED); + deadbeef->sendmessage (DB_EV_PLAYLISTCHANGED, 0, 0, 0); } @@ -1146,9 +1145,7 @@ on_sort_by_track_nr_activate (GtkMenuItem *menuitem, deadbeef->plt_sort (plt, PL_MAIN, -1, "%n", 1); deadbeef->plt_unref (plt); - DdbListview *pl = DDB_LISTVIEW (lookup_widget (mainwin, "playlist")); - ddb_listview_clear_sort (pl); - ddb_listview_refresh (pl, DDB_REFRESH_LIST | DDB_LIST_CHANGED); + deadbeef->sendmessage (DB_EV_PLAYLISTCHANGED, 0, 0, 0); } @@ -1160,9 +1157,7 @@ on_sort_by_album_activate (GtkMenuItem *menuitem, deadbeef->plt_sort (plt, PL_MAIN, -1, "%b", 1); deadbeef->plt_unref (plt); - DdbListview *pl = DDB_LISTVIEW (lookup_widget (mainwin, "playlist")); - ddb_listview_clear_sort (pl); - ddb_listview_refresh (pl, DDB_REFRESH_LIST | DDB_LIST_CHANGED); + deadbeef->sendmessage (DB_EV_PLAYLISTCHANGED, 0, 0, 0); } @@ -1174,9 +1169,7 @@ on_sort_by_artist_activate (GtkMenuItem *menuitem, deadbeef->plt_sort (plt, PL_MAIN, -1, "%a", 1); deadbeef->plt_unref (plt); - DdbListview *pl = DDB_LISTVIEW (lookup_widget (mainwin, "playlist")); - ddb_listview_clear_sort (pl); - ddb_listview_refresh (pl, DDB_REFRESH_LIST | DDB_LIST_CHANGED); + deadbeef->sendmessage (DB_EV_PLAYLISTCHANGED, 0, 0, 0); } @@ -1188,9 +1181,7 @@ on_sort_by_date_activate (GtkMenuItem *menuitem, deadbeef->plt_sort (plt, PL_MAIN, -1, "%y", 1); deadbeef->plt_unref (plt); - DdbListview *pl = DDB_LISTVIEW (lookup_widget (mainwin, "playlist")); - ddb_listview_clear_sort (pl); - ddb_listview_refresh (pl, DDB_REFRESH_LIST | DDB_LIST_CHANGED); + deadbeef->sendmessage (DB_EV_PLAYLISTCHANGED, 0, 0, 0); } @@ -1224,11 +1215,17 @@ on_sort_by_custom_activate (GtkMenuItem *menuitem, deadbeef->plt_sort (plt, PL_MAIN, -1, fmt, order == 0 ? 1 : 0); deadbeef->plt_unref (plt); - DdbListview *pl = DDB_LISTVIEW (lookup_widget (mainwin, "playlist")); - ddb_listview_clear_sort (pl); - ddb_listview_refresh (pl, DDB_REFRESH_LIST | DDB_LIST_CHANGED); + deadbeef->sendmessage (DB_EV_PLAYLISTCHANGED, 0, 0, 0); } gtk_widget_destroy (dlg); dlg = NULL; } + +void +on_design_mode1_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + +} + diff --git a/plugins/gtkui/callbacks.h b/plugins/gtkui/callbacks.h index fd92b376..1c407678 100644 --- a/plugins/gtkui/callbacks.h +++ b/plugins/gtkui/callbacks.h @@ -1155,3 +1155,7 @@ on_sort_by_custom_activate (GtkMenuItem *menuitem, void on_convert8to16_toggled (GtkToggleButton *togglebutton, gpointer user_data); + +void +on_design_mode1_activate (GtkMenuItem *menuitem, + gpointer user_data); diff --git a/plugins/gtkui/ddbtabstrip.c b/plugins/gtkui/ddbtabstrip.c index f8f3e6c4..d191ad33 100644 --- a/plugins/gtkui/ddbtabstrip.c +++ b/plugins/gtkui/ddbtabstrip.c @@ -25,7 +25,7 @@ #include "gtkui.h" #include "interface.h" #include "support.h" -#include "ddblistview.h" +#include "mainplaylist.h" #define GLADE_HOOKUP_OBJECT(component,widget,name) \ g_object_set_data_full (G_OBJECT (component), name, \ @@ -253,8 +253,6 @@ on_tabstrip_drag_data_received (GtkWidget *widget, guint target_type, guint time) { - DdbListview *ps = DDB_LISTVIEW (lookup_widget (mainwin, "playlist")); - gchar *ptr=(char*)data->data; if (target_type == 0) { // uris // this happens when dropped from file manager @@ -262,7 +260,7 @@ on_tabstrip_drag_data_received (GtkWidget *widget, memcpy (mem, ptr, data->length); mem[data->length] = 0; // we don't pass control structure, but there's only one drag-drop view currently - ps->binding->external_drag_n_drop (NULL, mem, data->length); + gtkui_receive_fm_drop (NULL, mem, data->length); } else if (target_type == 1) { uint32_t *d= (uint32_t *)ptr; @@ -271,7 +269,8 @@ on_tabstrip_drag_data_received (GtkWidget *widget, int length = (data->length/4)-1; ddb_playlist_t *p = deadbeef->plt_get_for_idx (plt); if (p) { - ps->binding->drag_n_drop (NULL, p, d, length, drag_context->action == GDK_ACTION_COPY ? 1 : 0); + //ps->binding->drag_n_drop (NULL, p, d, length, drag_context->action == GDK_ACTION_COPY ? 1 : 0); + main_drag_n_drop (NULL, p, d, length, drag_context->action == GDK_ACTION_COPY ? 1 : 0); deadbeef->plt_unref (p); } } @@ -283,16 +282,16 @@ on_tabstrip_drag_leave (GtkWidget *widget, GdkDragContext *drag_context, guint time) { - DdbListview *pl = DDB_LISTVIEW (lookup_widget (mainwin, "playlist")); - ddb_listview_list_drag_leave (pl->list, drag_context, time, NULL); +// DdbListview *pl = DDB_LISTVIEW (lookup_widget (mainwin, "playlist")); +// ddb_listview_list_drag_leave (pl->list, drag_context, time, NULL); } void on_tabstrip_drag_end (GtkWidget *widget, GdkDragContext *drag_context) { - DdbListview *pl = DDB_LISTVIEW (lookup_widget (mainwin, "playlist")); - ddb_listview_list_drag_end (pl->list, drag_context, NULL); +// DdbListview *pl = DDB_LISTVIEW (lookup_widget (mainwin, "playlist")); +// ddb_listview_list_drag_end (pl->list, drag_context, NULL); } GtkWidget * ddb_tabstrip_new() { @@ -713,8 +712,6 @@ on_remove_playlist1_activate (GtkMenuItem *menuitem, { if (tab_clicked != -1) { deadbeef->plt_remove (tab_clicked); - DdbListview *pl = DDB_LISTVIEW (lookup_widget (mainwin, "playlist")); - ddb_listview_refresh (pl, DDB_LIST_CHANGED | DDB_REFRESH_LIST | DDB_REFRESH_VSCROLL); search_refresh (); int playlist = deadbeef->plt_get_curr_idx (); deadbeef->conf_set_int ("playlist.current", playlist); @@ -910,8 +907,6 @@ on_tabstrip_button_press_event(GtkWidget *widget, if (tab_clicked != -1) { deadbeef->plt_remove (tab_clicked); // force invalidation of playlist cache - DdbListview *pl = DDB_LISTVIEW (lookup_widget (mainwin, "playlist")); - ddb_listview_refresh (pl, DDB_LIST_CHANGED | DDB_REFRESH_LIST | DDB_REFRESH_VSCROLL); search_refresh (); int playlist = deadbeef->plt_get_curr_idx (); deadbeef->conf_set_int ("playlist.current", playlist); diff --git a/plugins/gtkui/deadbeef.glade b/plugins/gtkui/deadbeef.glade index 73759b65..926fa6ab 100644 --- a/plugins/gtkui/deadbeef.glade +++ b/plugins/gtkui/deadbeef.glade @@ -62,7 +62,7 @@ <accelerator key="O" modifiers="GDK_CONTROL_MASK" signal="activate"/> <child internal-child="image"> - <widget class="GtkImage" id="image555"> + <widget class="GtkImage" id="image563"> <property name="visible">True</property> <property name="stock">gtk-open</property> <property name="icon_size">1</property> @@ -89,7 +89,7 @@ <signal name="activate" handler="on_add_files_activate" last_modification_time="Sat, 04 Jul 2009 13:04:01 GMT"/> <child internal-child="image"> - <widget class="GtkImage" id="image556"> + <widget class="GtkImage" id="image564"> <property name="visible">True</property> <property name="stock">gtk-add</property> <property name="icon_size">1</property> @@ -110,7 +110,7 @@ <signal name="activate" handler="on_add_folders_activate" last_modification_time="Sun, 06 Sep 2009 17:51:40 GMT"/> <child internal-child="image"> - <widget class="GtkImage" id="image557"> + <widget class="GtkImage" id="image565"> <property name="visible">True</property> <property name="stock">gtk-add</property> <property name="icon_size">1</property> @@ -181,7 +181,7 @@ <accelerator key="Q" modifiers="GDK_CONTROL_MASK" signal="activate"/> <child internal-child="image"> - <widget class="GtkImage" id="image558"> + <widget class="GtkImage" id="image566"> <property name="visible">True</property> <property name="stock">gtk-quit</property> <property name="icon_size">1</property> @@ -215,7 +215,7 @@ <signal name="activate" handler="on_clear1_activate" last_modification_time="Sun, 06 Sep 2009 18:30:03 GMT"/> <child internal-child="image"> - <widget class="GtkImage" id="image559"> + <widget class="GtkImage" id="image567"> <property name="visible">True</property> <property name="stock">gtk-clear</property> <property name="icon_size">1</property> @@ -274,7 +274,7 @@ <signal name="activate" handler="on_remove1_activate" last_modification_time="Sun, 06 Sep 2009 18:30:03 GMT"/> <child internal-child="image"> - <widget class="GtkImage" id="image560"> + <widget class="GtkImage" id="image568"> <property name="visible">True</property> <property name="stock">gtk-remove</property> <property name="icon_size">1</property> @@ -444,6 +444,16 @@ <signal name="activate" handler="on_toggle_eq" last_modification_time="Sat, 20 Mar 2010 12:28:50 GMT"/> </widget> </child> + + <child> + <widget class="GtkCheckMenuItem" id="design_mode1"> + <property name="visible">True</property> + <property name="label" translatable="yes">Design mode</property> + <property name="use_underline">True</property> + <property name="active">False</property> + <signal name="activate" handler="on_design_mode1_activate" last_modification_time="Fri, 17 Jun 2011 19:10:50 GMT"/> + </widget> + </child> </widget> </child> </widget> @@ -472,7 +482,7 @@ <property name="visible">True</property> <property name="label" translatable="yes">Linear</property> <property name="use_underline">True</property> - <property name="active">False</property> + <property name="active">True</property> <signal name="activate" handler="on_order_linear_activate" last_modification_time="Sat, 08 Aug 2009 12:26:33 GMT"/> </widget> </child> @@ -482,7 +492,7 @@ <property name="visible">True</property> <property name="label" translatable="yes">Shuffle tracks</property> <property name="use_underline">True</property> - <property name="active">False</property> + <property name="active">True</property> <property name="group">order_linear</property> <signal name="activate" handler="on_order_shuffle_activate" last_modification_time="Fri, 21 Aug 2009 16:46:02 GMT"/> </widget> @@ -493,7 +503,7 @@ <property name="visible">True</property> <property name="label" translatable="yes">Shuffle albums</property> <property name="use_underline">True</property> - <property name="active">False</property> + <property name="active">True</property> <property name="group">order_linear</property> <signal name="activate" handler="on_order_shuffle_albums_activate" last_modification_time="Sun, 12 Dec 2010 18:14:47 GMT"/> </widget> @@ -528,7 +538,7 @@ <property name="visible">True</property> <property name="label" translatable="yes">Loop All</property> <property name="use_underline">True</property> - <property name="active">False</property> + <property name="active">True</property> <signal name="activate" handler="on_loop_all_activate" last_modification_time="Sat, 08 Aug 2009 12:26:33 GMT"/> </widget> </child> @@ -538,7 +548,7 @@ <property name="visible">True</property> <property name="label" translatable="yes">Loop Single Song</property> <property name="use_underline">True</property> - <property name="active">False</property> + <property name="active">True</property> <property name="group">loop_all</property> <signal name="activate" handler="on_loop_single_activate" last_modification_time="Sat, 08 Aug 2009 12:26:33 GMT"/> </widget> @@ -627,7 +637,7 @@ <signal name="activate" handler="on_help1_activate" last_modification_time="Tue, 08 Sep 2009 17:32:06 GMT"/> <child internal-child="image"> - <widget class="GtkImage" id="image561"> + <widget class="GtkImage" id="image569"> <property name="visible">True</property> <property name="stock">gtk-help</property> <property name="icon_size">1</property> @@ -687,7 +697,7 @@ <signal name="activate" handler="on_about1_activate" last_modification_time="Sat, 04 Jul 2009 12:57:58 GMT"/> <child internal-child="image"> - <widget class="GtkImage" id="image562"> + <widget class="GtkImage" id="image570"> <property name="visible">True</property> <property name="stock">gtk-about</property> <property name="icon_size">1</property> @@ -708,7 +718,7 @@ <signal name="activate" handler="on_translators1_activate" last_modification_time="Sun, 19 Sep 2010 13:38:07 GMT"/> <child internal-child="image"> - <widget class="GtkImage" id="image563"> + <widget class="GtkImage" id="image571"> <property name="visible">True</property> <property name="stock">gtk-about</property> <property name="icon_size">1</property> @@ -928,47 +938,6 @@ </child> <child> - <widget class="Custom" id="tabstrip"> - <property name="height_request">24</property> - <property name="visible">True</property> - <property name="creation_function">create_tabstrip_widget</property> - <property name="int1">0</property> - <property name="int2">0</property> - <property name="last_modification_time">Thu, 18 Feb 2010 18:05:36 GMT</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="frame1"> - <property name="border_width">1</property> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="Custom" id="playlist"> - <property name="visible">True</property> - <property name="creation_function">create_ddb_listview_widget</property> - <property name="int1">0</property> - <property name="int2">0</property> - <property name="last_modification_time">Sat, 13 Feb 2010 20:26:03 GMT</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> <widget class="GtkVBox" id="plugins_bottom_vbox"> <property name="visible">True</property> <property name="homogeneous">False</property> @@ -980,8 +949,8 @@ </widget> <packing> <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> + <property name="expand">True</property> + <property name="fill">True</property> </packing> </child> diff --git a/plugins/gtkui/fileman.c b/plugins/gtkui/fileman.c index 8947c821..4b1b6949 100644 --- a/plugins/gtkui/fileman.c +++ b/plugins/gtkui/fileman.c @@ -104,17 +104,15 @@ static void open_files_worker (void *data) { GSList *lst = (GSList *)data; gtkpl_add_files (lst); - gtkui_playlist_changed (); - extern GtkWidget *mainwin; - DdbListview *pl = DDB_LISTVIEW (lookup_widget (mainwin, "playlist")); - ddb_listview_set_cursor (pl, 0); + deadbeef->pl_set_cursor (PL_MAIN, 0); + deadbeef->sendmessage (DB_EV_PLAYLISTCHANGED, 0, 0, 0); deadbeef->sendmessage (DB_EV_PLAY_CURRENT, 0, 1, 0); } void gtkui_open_files (struct _GSList *lst) { deadbeef->pl_clear (); - playlist_refresh (); + deadbeef->sendmessage (DB_EV_PLAYLISTCHANGED, 0, 0, 0); intptr_t tid = deadbeef->thread_start (open_files_worker, lst); deadbeef->thread_detach (tid); @@ -164,13 +162,14 @@ strcopy_special (char *dest, const char *src, int len) { static gboolean set_dnd_cursor_idle (gpointer data) { - DdbListview *listview = DDB_LISTVIEW (lookup_widget (mainwin, "playlist")); if (!data) { - ddb_listview_set_cursor (listview, -1); + deadbeef->pl_set_cursor (PL_MAIN, -1); + deadbeef->sendmessage (DB_EV_PLAYLISTCHANGED, 0, 0, 0); return FALSE; } int cursor = deadbeef->pl_get_idx_of (DB_PLAYITEM (data)); - ddb_listview_set_cursor (listview, cursor); + deadbeef->pl_set_cursor (PL_MAIN, cursor); + deadbeef->sendmessage (DB_EV_PLAYLISTCHANGED, 0, 0, 0); return FALSE; } @@ -182,7 +181,6 @@ gtkpl_add_fm_dropped_files (DB_playItem_t *drop_before, char *ptr, int length) { deadbeef->plt_unref (plt); return; } - DdbListview *pl = DDB_LISTVIEW (lookup_widget (mainwin, "playlist")); DdbListviewIter first = NULL; DdbListviewIter after = NULL; diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c index 4dd222b1..3914547b 100644 --- a/plugins/gtkui/gtkui.c +++ b/plugins/gtkui/gtkui.c @@ -29,7 +29,6 @@ #include "../../gettext.h" #include "gtkui.h" #include "ddblistview.h" -#include "mainplaylist.h" #include "search.h" #include "progress.h" #include "interface.h" @@ -47,6 +46,7 @@ #include "pluginconf.h" #include "gtkui_api.h" #include "wingeom.h" +#include "widgets.h" #define trace(...) { fprintf(stderr, __VA_ARGS__); } //#define trace(fmt,...) @@ -61,6 +61,7 @@ DB_artwork_plugin_t *coverart_plugin = NULL; // main widgets GtkWidget *mainwin; +ddb_gtkui_widget_t *rootwidget; GtkWidget *searchwin; GtkStatusIcon *trayicon; GtkWidget *traymenu; @@ -337,7 +338,7 @@ activate_cb (gpointer nothing) { } void -redraw_queued_tracks (DdbListview *pl, int list) { +redraw_queued_tracks (DdbListview *pl) { DB_playItem_t *it; int idx = 0; deadbeef->pl_lock (); @@ -352,14 +353,10 @@ redraw_queued_tracks (DdbListview *pl, int list) { deadbeef->pl_unlock (); } -static gboolean -redraw_queued_tracks_cb (gpointer nothing) { - int iconified = gdk_window_get_state(mainwin->window) & GDK_WINDOW_STATE_ICONIFIED; - if (!gtk_widget_get_visible (mainwin) || iconified) { - return FALSE; - } - redraw_queued_tracks (DDB_LISTVIEW (lookup_widget (mainwin, "playlist")), PL_MAIN); - redraw_queued_tracks (DDB_LISTVIEW (lookup_widget (searchwin, "searchlist")), PL_SEARCH); +gboolean +redraw_queued_tracks_cb (gpointer plt) { + DdbListview *list = plt; + redraw_queued_tracks (list); return FALSE; } @@ -376,7 +373,12 @@ gtkpl_songchanged_wrapper (DB_playItem_t *from, DB_playItem_t *to) { } g_idle_add (update_win_title_idle, ft); g_idle_add (redraw_seekbar_cb, NULL); - g_idle_add (redraw_queued_tracks_cb, NULL); + if (searchwin && searchwin->window) { + int iconified = gdk_window_get_state(searchwin->window) & GDK_WINDOW_STATE_ICONIFIED; + if (gtk_widget_get_visible (searchwin) && !iconified) { + g_idle_add (redraw_queued_tracks_cb, DDB_LISTVIEW (lookup_widget (searchwin, "searchlist"))); + } + } } void @@ -415,8 +417,8 @@ trackinfochanged_wrapper (DdbListview *playlist, DB_playItem_t *track, int iter) void gtkui_trackinfochanged (DB_playItem_t *track) { - GtkWidget *playlist = lookup_widget (mainwin, "playlist"); - trackinfochanged_wrapper (DDB_LISTVIEW (playlist), track, PL_MAIN); +// GtkWidget *playlist = lookup_widget (mainwin, "playlist"); +// trackinfochanged_wrapper (DDB_LISTVIEW (playlist), track, PL_MAIN); if (searchwin && gtk_widget_get_visible (searchwin)) { GtkWidget *search = lookup_widget (searchwin, "searchlist"); @@ -441,22 +443,10 @@ trackinfochanged_cb (gpointer data) { return FALSE; } -static gboolean -paused_cb (gpointer nothing) { - DB_playItem_t *curr = deadbeef->streamer_get_playing_track (); - if (curr) { - int idx = deadbeef->pl_get_idx_of (curr); - GtkWidget *playlist = lookup_widget (mainwin, "playlist"); - ddb_listview_draw_row (DDB_LISTVIEW (playlist), idx, (DdbListviewIter)curr); - deadbeef->pl_item_unref (curr); - } - return FALSE; -} - void playlist_refresh (void) { - DdbListview *ps = DDB_LISTVIEW (lookup_widget (mainwin, "playlist")); - ddb_listview_refresh (ps, DDB_REFRESH_LIST | DDB_REFRESH_VSCROLL); +// DdbListview *ps = DDB_LISTVIEW (lookup_widget (mainwin, "playlist")); +// ddb_listview_refresh (ps, DDB_REFRESH_LIST | DDB_REFRESH_VSCROLL); search_refresh (); } @@ -473,26 +463,6 @@ gtkui_playlist_changed (void) { static gboolean playlistswitch_cb (gpointer none) { - GtkWidget *tabstrip = lookup_widget (mainwin, "tabstrip"); - int curr = deadbeef->plt_get_curr_idx (); - char conf[100]; - snprintf (conf, sizeof (conf), "playlist.scroll.%d", curr); - int scroll = deadbeef->conf_get_int (conf, 0); - snprintf (conf, sizeof (conf), "playlist.cursor.%d", curr); - int cursor = deadbeef->conf_get_int (conf, -1); - ddb_tabstrip_refresh (DDB_TABSTRIP (tabstrip)); - DdbListview *listview = DDB_LISTVIEW (lookup_widget (mainwin, "playlist")); - deadbeef->pl_set_cursor (PL_MAIN, cursor); - if (cursor != -1) { - DB_playItem_t *it = deadbeef->pl_get_for_idx_and_iter (cursor, PL_MAIN); - if (it) { - deadbeef->pl_set_selected (it, 1); - deadbeef->pl_item_unref (it); - } - } - - ddb_listview_refresh (listview, DDB_LIST_CHANGED | DDB_REFRESH_LIST | DDB_REFRESH_VSCROLL); - ddb_listview_set_vscroll (listview, scroll); search_refresh (); return FALSE; } @@ -825,40 +795,6 @@ on_add_location_activate (GtkMenuItem *menuitem, gtk_widget_destroy (dlg); } -static void -songchanged (DdbListview *ps, DB_playItem_t *from, DB_playItem_t *to) { - int to_idx = -1; - if (!ddb_listview_is_scrolling (ps) && to) { - int cursor_follows_playback = deadbeef->conf_get_int ("playlist.scroll.cursorfollowplayback", 0); - int scroll_follows_playback = deadbeef->conf_get_int ("playlist.scroll.followplayback", 0); - int plt = deadbeef->streamer_get_current_playlist (); - if (plt != -1) { - if (cursor_follows_playback && plt != deadbeef->plt_get_curr_idx ()) { - deadbeef->plt_set_curr_idx (plt); - } - to_idx = deadbeef->pl_get_idx_of (to); - if (to_idx != -1) { - if (cursor_follows_playback) { - ddb_listview_set_cursor_noscroll (ps, to_idx); - } - if (scroll_follows_playback && plt == deadbeef->plt_get_curr_idx ()) { - ddb_listview_scroll_to (ps, to_idx); - } - } - } - } - - if (from) { - int idx = deadbeef->pl_get_idx_of (from); - if (idx != -1) { - ddb_listview_draw_row (ps, idx, from); - } - } - if (to && to_idx != -1) { - ddb_listview_draw_row (ps, to_idx, to); - } -} - static gboolean update_win_title_idle (gpointer data) { struct fromto_t *ft = (struct fromto_t *)data; @@ -882,8 +818,6 @@ update_win_title_idle (gpointer data) { gtkui_set_titlebar (NULL); } } - // update playlist view - songchanged (DDB_LISTVIEW (lookup_widget (mainwin, "playlist")), from, to); if (from) { deadbeef->pl_item_unref (from); } @@ -941,11 +875,11 @@ volumebar_redraw (void) { gdk_window_invalidate_rect (volumebar->window, NULL, FALSE); } -void -tabstrip_redraw (void) { - GtkWidget *ts = lookup_widget (mainwin, "tabstrip"); - ddb_tabstrip_refresh (DDB_TABSTRIP (ts)); -} +//void +//tabstrip_redraw (void) { +// GtkWidget *ts = lookup_widget (mainwin, "tabstrip"); +// ddb_tabstrip_refresh (DDB_TABSTRIP (ts)); +//} static int gtk_initialized = 0; static gint refresh_timeout = 0; @@ -970,8 +904,21 @@ gtkui_setup_gui_refresh (void) { refresh_timeout = g_timeout_add (tm, gtkui_on_frameupdate, NULL); } +static void +send_messages_to_widgets (ddb_gtkui_widget_t *w, uint32_t id, uintptr_t ctx, uint32_t p1, uint32_t p2) { + for (ddb_gtkui_widget_t *c = w->children; c; c = c->next) { + send_messages_to_widgets (c, id, ctx, p1, p2); + } + if (w->message) { + w->message (w, id, ctx, p1, p2); + } +} + int gtkui_message (uint32_t id, uintptr_t ctx, uint32_t p1, uint32_t p2) { + if (rootwidget) { + send_messages_to_widgets (rootwidget, id, ctx, p1, p2); + } switch (id) { case DB_EV_ACTIVATED: g_idle_add (activate_cb, NULL); @@ -991,9 +938,9 @@ gtkui_message (uint32_t id, uintptr_t ctx, uint32_t p1, uint32_t p2) { g_idle_add (trackinfochanged_cb, ev->track); } break; - case DB_EV_PAUSED: - g_idle_add (paused_cb, NULL); - break; +// case DB_EV_PAUSED: +// g_idle_add (paused_cb, NULL); +// break; case DB_EV_PLAYLISTCHANGED: gtkui_playlist_changed (); break; @@ -1034,6 +981,19 @@ gtkui_thread (void *ctx) { gtk_init (&argc, (char ***)&argv); mainwin = create_mainwin (); + + // construct mainwindow widgets + { + // root widget is a box + rootwidget = w_create_box (); + gtk_widget_show (rootwidget->widget); + gtk_box_pack_start (GTK_BOX(lookup_widget(mainwin, "plugins_bottom_vbox")), rootwidget->widget, TRUE, TRUE, 0); + ddb_gtkui_widget_t *plt = w_tabbed_playlist_create (); + w_append (rootwidget, plt); + gtk_box_pack_start (GTK_BOX(rootwidget->widget), plt->widget, TRUE, TRUE, 0); + gtk_widget_show (plt->widget); + } + gtkpl_init (); GtkIconTheme *theme = gtk_icon_theme_get_default(); @@ -1074,16 +1034,13 @@ gtkui_thread (void *ctx) { searchwin = create_searchwin (); gtk_window_set_transient_for (GTK_WINDOW (searchwin), GTK_WINDOW (mainwin)); - DdbListview *main_playlist = DDB_LISTVIEW (lookup_widget (mainwin, "playlist")); - main_playlist_init (GTK_WIDGET (main_playlist)); - +// DdbListview *main_playlist = DDB_LISTVIEW (lookup_widget (mainwin, "playlist")); +// main_playlist_init (GTK_WIDGET (main_playlist)); if (deadbeef->conf_get_int ("gtkui.headers.visible", 1)) { gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (header_mi), TRUE); - ddb_listview_show_header (main_playlist, 1); } else { gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (header_mi), FALSE); - ddb_listview_show_header (main_playlist, 0); } DdbListview *search_playlist = DDB_LISTVIEW (lookup_widget (searchwin, "searchlist")); @@ -1311,7 +1268,7 @@ gtkui_stop (void) { deadbeef->thread_join (gtk_tid); trace ("gtk thread finished\n"); gtk_tid = 0; - main_playlist_free (); + //main_playlist_free (); trace ("gtkui_stop completed\n"); return 0; } diff --git a/plugins/gtkui/gtkui.h b/plugins/gtkui/gtkui.h index e2ed8dbf..f3b075d3 100644 --- a/plugins/gtkui/gtkui.h +++ b/plugins/gtkui/gtkui.h @@ -133,8 +133,8 @@ on_seekbar_motion_notify_event (GtkWidget *widget, void volumebar_redraw (void); -void -tabstrip_redraw (void); +//void +//tabstrip_redraw (void); void gtkui_playlist_changed (void); @@ -172,4 +172,7 @@ gtkui_get_curr_playlist_mod (void); void gtkui_trackinfochanged (DB_playItem_t *it); +gboolean +redraw_queued_tracks_cb (gpointer plt); + #endif diff --git a/plugins/gtkui/gtkui_api.h b/plugins/gtkui/gtkui_api.h index f20c411e..0857e886 100644 --- a/plugins/gtkui/gtkui_api.h +++ b/plugins/gtkui/gtkui_api.h @@ -25,9 +25,22 @@ #ifndef __GTKUI_API_H #define __GTKUI_API_H +typedef struct ddb_gtkui_widget_s { + const char *type; + GtkWidget *widget; + + void (*destroy) (struct ddb_gtkui_widget_s *w); + int (*message) (struct ddb_gtkui_widget_s *w, uint32_t id, uintptr_t ctx, uint32_t p1, uint32_t p2); + struct ddb_gtkui_widget_s *children; + struct ddb_gtkui_widget_s *next; // points to next widget in the same container +} ddb_gtkui_widget_t; + typedef struct { DB_gui_t gui; GtkWidget * (*get_mainwin) (void); + void (*reg_widget) (const char *type, ddb_gtkui_widget_t *(*create_func) (void)); + void (*unreg_widget) (const char *type); + ddb_gtkui_widget_t * (*get_root_widget) (void); } ddb_gtkui_t; #endif diff --git a/plugins/gtkui/interface.c b/plugins/gtkui/interface.c index 67d70dba..d09e9dc7 100644 --- a/plugins/gtkui/interface.c +++ b/plugins/gtkui/interface.c @@ -35,12 +35,12 @@ create_mainwin (void) GtkWidget *File; GtkWidget *File_menu; GtkWidget *open; - GtkWidget *image555; + GtkWidget *image563; GtkWidget *separator2; GtkWidget *add_files; - GtkWidget *image556; + GtkWidget *image564; GtkWidget *add_folders; - GtkWidget *image557; + GtkWidget *image565; GtkWidget *add_location1; GtkWidget *separatormenuitem1; GtkWidget *new_playlist1; @@ -48,18 +48,18 @@ create_mainwin (void) GtkWidget *playlist_save_as; GtkWidget *separator8; GtkWidget *quit; - GtkWidget *image558; + GtkWidget *image566; GtkWidget *Edit; GtkWidget *Edit_menu; GtkWidget *clear1; - GtkWidget *image559; + GtkWidget *image567; GtkWidget *select_all1; GtkWidget *deselect_all1; GtkWidget *invert_selection1; GtkWidget *Selection; GtkWidget *Selection_menu; GtkWidget *remove1; - GtkWidget *image560; + GtkWidget *image568; GtkWidget *crop1; GtkWidget *find1; GtkWidget *sort_by1; @@ -78,6 +78,7 @@ create_mainwin (void) GtkWidget *view_headers; GtkWidget *view_tabs; GtkWidget *view_eq; + GtkWidget *design_mode1; GtkWidget *Playback; GtkWidget *Playback_menu; GtkWidget *Order; @@ -101,16 +102,16 @@ create_mainwin (void) GtkWidget *Help; GtkWidget *Help_menu; GtkWidget *help1; - GtkWidget *image561; + GtkWidget *image569; GtkWidget *changelog1; GtkWidget *separator10; GtkWidget *gpl1; GtkWidget *lgpl1; GtkWidget *separator9; GtkWidget *about1; - GtkWidget *image562; + GtkWidget *image570; GtkWidget *translators1; - GtkWidget *image563; + GtkWidget *image571; GtkWidget *hbox2; GtkWidget *hbox3; GtkWidget *stopbtn; @@ -125,9 +126,6 @@ create_mainwin (void) GtkWidget *image5; GtkWidget *seekbar; GtkWidget *volumebar; - GtkWidget *tabstrip; - GtkWidget *frame1; - GtkWidget *playlist; GtkWidget *plugins_bottom_vbox; GtkWidget *statusbar; GtkAccelGroup *accel_group; @@ -161,9 +159,9 @@ create_mainwin (void) GDK_O, (GdkModifierType) GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); - image555 = gtk_image_new_from_stock ("gtk-open", GTK_ICON_SIZE_MENU); - gtk_widget_show (image555); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (open), image555); + image563 = gtk_image_new_from_stock ("gtk-open", GTK_ICON_SIZE_MENU); + gtk_widget_show (image563); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (open), image563); separator2 = gtk_separator_menu_item_new (); gtk_widget_show (separator2); @@ -174,17 +172,17 @@ create_mainwin (void) gtk_widget_show (add_files); gtk_container_add (GTK_CONTAINER (File_menu), add_files); - image556 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); - gtk_widget_show (image556); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (add_files), image556); + image564 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); + gtk_widget_show (image564); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (add_files), image564); add_folders = gtk_image_menu_item_new_with_mnemonic (_("Add folder(s)")); gtk_widget_show (add_folders); gtk_container_add (GTK_CONTAINER (File_menu), add_folders); - image557 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); - gtk_widget_show (image557); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (add_folders), image557); + image565 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); + gtk_widget_show (image565); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (add_folders), image565); add_location1 = gtk_menu_item_new_with_mnemonic (_("Add location")); gtk_widget_show (add_location1); @@ -222,9 +220,9 @@ create_mainwin (void) GDK_Q, (GdkModifierType) GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); - image558 = gtk_image_new_from_stock ("gtk-quit", GTK_ICON_SIZE_MENU); - gtk_widget_show (image558); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (quit), image558); + image566 = gtk_image_new_from_stock ("gtk-quit", GTK_ICON_SIZE_MENU); + gtk_widget_show (image566); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (quit), image566); Edit = gtk_menu_item_new_with_mnemonic (_("_Edit")); gtk_widget_show (Edit); @@ -237,9 +235,9 @@ create_mainwin (void) gtk_widget_show (clear1); gtk_container_add (GTK_CONTAINER (Edit_menu), clear1); - image559 = gtk_image_new_from_stock ("gtk-clear", GTK_ICON_SIZE_MENU); - gtk_widget_show (image559); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (clear1), image559); + image567 = gtk_image_new_from_stock ("gtk-clear", GTK_ICON_SIZE_MENU); + gtk_widget_show (image567); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (clear1), image567); select_all1 = gtk_menu_item_new_with_mnemonic (_("Select all")); gtk_widget_show (select_all1); @@ -270,9 +268,9 @@ create_mainwin (void) gtk_widget_show (remove1); gtk_container_add (GTK_CONTAINER (Selection_menu), remove1); - image560 = gtk_image_new_from_stock ("gtk-remove", GTK_ICON_SIZE_MENU); - gtk_widget_show (image560); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (remove1), image560); + image568 = gtk_image_new_from_stock ("gtk-remove", GTK_ICON_SIZE_MENU); + gtk_widget_show (image568); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (remove1), image568); crop1 = gtk_menu_item_new_with_mnemonic (_("Crop")); gtk_widget_show (crop1); @@ -348,6 +346,10 @@ create_mainwin (void) gtk_widget_show (view_eq); gtk_container_add (GTK_CONTAINER (View_menu), view_eq); + design_mode1 = gtk_check_menu_item_new_with_mnemonic (_("Design mode")); + gtk_widget_show (design_mode1); + gtk_container_add (GTK_CONTAINER (View_menu), design_mode1); + Playback = gtk_menu_item_new_with_mnemonic (_("_Playback")); gtk_widget_show (Playback); gtk_container_add (GTK_CONTAINER (menubar1), Playback); @@ -366,16 +368,19 @@ create_mainwin (void) order_linear_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (order_linear)); gtk_widget_show (order_linear); gtk_container_add (GTK_CONTAINER (Order_menu), order_linear); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (order_linear), TRUE); order_shuffle = gtk_radio_menu_item_new_with_mnemonic (order_linear_group, _("Shuffle tracks")); order_linear_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (order_shuffle)); gtk_widget_show (order_shuffle); gtk_container_add (GTK_CONTAINER (Order_menu), order_shuffle); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (order_shuffle), TRUE); order_shuffle_albums = gtk_radio_menu_item_new_with_mnemonic (order_linear_group, _("Shuffle albums")); order_linear_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (order_shuffle_albums)); gtk_widget_show (order_shuffle_albums); gtk_container_add (GTK_CONTAINER (Order_menu), order_shuffle_albums); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (order_shuffle_albums), TRUE); order_random = gtk_radio_menu_item_new_with_mnemonic (order_linear_group, _("Random")); order_linear_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (order_random)); @@ -394,11 +399,13 @@ create_mainwin (void) loop_all_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (loop_all)); gtk_widget_show (loop_all); gtk_container_add (GTK_CONTAINER (Looping_menu), loop_all); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (loop_all), TRUE); loop_single = gtk_radio_menu_item_new_with_mnemonic (loop_all_group, _("Loop Single Song")); loop_all_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (loop_single)); gtk_widget_show (loop_single); gtk_container_add (GTK_CONTAINER (Looping_menu), loop_single); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (loop_single), TRUE); loop_disable = gtk_radio_menu_item_new_with_mnemonic (loop_all_group, _("Don't Loop")); loop_all_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (loop_disable)); @@ -445,9 +452,9 @@ create_mainwin (void) gtk_widget_show (help1); gtk_container_add (GTK_CONTAINER (Help_menu), help1); - image561 = gtk_image_new_from_stock ("gtk-help", GTK_ICON_SIZE_MENU); - gtk_widget_show (image561); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (help1), image561); + image569 = gtk_image_new_from_stock ("gtk-help", GTK_ICON_SIZE_MENU); + gtk_widget_show (image569); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (help1), image569); changelog1 = gtk_menu_item_new_with_mnemonic (_("_ChangeLog")); gtk_widget_show (changelog1); @@ -475,17 +482,17 @@ create_mainwin (void) gtk_widget_show (about1); gtk_container_add (GTK_CONTAINER (Help_menu), about1); - image562 = gtk_image_new_from_stock ("gtk-about", GTK_ICON_SIZE_MENU); - gtk_widget_show (image562); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (about1), image562); + image570 = gtk_image_new_from_stock ("gtk-about", GTK_ICON_SIZE_MENU); + gtk_widget_show (image570); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (about1), image570); translators1 = gtk_image_menu_item_new_with_mnemonic (_("_Translators")); gtk_widget_show (translators1); gtk_container_add (GTK_CONTAINER (Help_menu), translators1); - image563 = gtk_image_new_from_stock ("gtk-about", GTK_ICON_SIZE_MENU); - gtk_widget_show (image563); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (translators1), image563); + image571 = gtk_image_new_from_stock ("gtk-about", GTK_ICON_SIZE_MENU); + gtk_widget_show (image571); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (translators1), image571); hbox2 = gtk_hbox_new (FALSE, 0); gtk_widget_show (hbox2); @@ -580,27 +587,9 @@ create_mainwin (void) GTK_WIDGET_UNSET_FLAGS (volumebar, GTK_CAN_FOCUS); GTK_WIDGET_UNSET_FLAGS (volumebar, GTK_CAN_DEFAULT); - tabstrip = create_tabstrip_widget ("tabstrip", "", "", 0, 0); - gtk_widget_show (tabstrip); - gtk_box_pack_start (GTK_BOX (vbox1), tabstrip, FALSE, TRUE, 0); - gtk_widget_set_size_request (tabstrip, -1, 24); - GTK_WIDGET_UNSET_FLAGS (tabstrip, GTK_CAN_FOCUS); - GTK_WIDGET_UNSET_FLAGS (tabstrip, GTK_CAN_DEFAULT); - - frame1 = gtk_frame_new (NULL); - gtk_widget_show (frame1); - gtk_box_pack_start (GTK_BOX (vbox1), frame1, TRUE, TRUE, 0); - gtk_container_set_border_width (GTK_CONTAINER (frame1), 1); - - playlist = create_ddb_listview_widget ("playlist", "", "", 0, 0); - gtk_widget_show (playlist); - gtk_container_add (GTK_CONTAINER (frame1), playlist); - GTK_WIDGET_UNSET_FLAGS (playlist, GTK_CAN_FOCUS); - GTK_WIDGET_UNSET_FLAGS (playlist, GTK_CAN_DEFAULT); - plugins_bottom_vbox = gtk_vbox_new (FALSE, 0); gtk_widget_show (plugins_bottom_vbox); - gtk_box_pack_start (GTK_BOX (vbox1), plugins_bottom_vbox, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox1), plugins_bottom_vbox, TRUE, TRUE, 0); statusbar = gtk_statusbar_new (); gtk_widget_show (statusbar); @@ -711,6 +700,9 @@ create_mainwin (void) g_signal_connect ((gpointer) view_eq, "activate", G_CALLBACK (on_toggle_eq), NULL); + g_signal_connect ((gpointer) design_mode1, "activate", + G_CALLBACK (on_design_mode1_activate), + NULL); g_signal_connect ((gpointer) order_linear, "activate", G_CALLBACK (on_order_linear_activate), NULL); @@ -785,12 +777,12 @@ create_mainwin (void) GLADE_HOOKUP_OBJECT (mainwin, File, "File"); GLADE_HOOKUP_OBJECT (mainwin, File_menu, "File_menu"); GLADE_HOOKUP_OBJECT (mainwin, open, "open"); - GLADE_HOOKUP_OBJECT (mainwin, image555, "image555"); + GLADE_HOOKUP_OBJECT (mainwin, image563, "image563"); GLADE_HOOKUP_OBJECT (mainwin, separator2, "separator2"); GLADE_HOOKUP_OBJECT (mainwin, add_files, "add_files"); - GLADE_HOOKUP_OBJECT (mainwin, image556, "image556"); + GLADE_HOOKUP_OBJECT (mainwin, image564, "image564"); GLADE_HOOKUP_OBJECT (mainwin, add_folders, "add_folders"); - GLADE_HOOKUP_OBJECT (mainwin, image557, "image557"); + GLADE_HOOKUP_OBJECT (mainwin, image565, "image565"); GLADE_HOOKUP_OBJECT (mainwin, add_location1, "add_location1"); GLADE_HOOKUP_OBJECT (mainwin, separatormenuitem1, "separatormenuitem1"); GLADE_HOOKUP_OBJECT (mainwin, new_playlist1, "new_playlist1"); @@ -798,18 +790,18 @@ create_mainwin (void) GLADE_HOOKUP_OBJECT (mainwin, playlist_save_as, "playlist_save_as"); GLADE_HOOKUP_OBJECT (mainwin, separator8, "separator8"); GLADE_HOOKUP_OBJECT (mainwin, quit, "quit"); - GLADE_HOOKUP_OBJECT (mainwin, image558, "image558"); + GLADE_HOOKUP_OBJECT (mainwin, image566, "image566"); GLADE_HOOKUP_OBJECT (mainwin, Edit, "Edit"); GLADE_HOOKUP_OBJECT (mainwin, Edit_menu, "Edit_menu"); GLADE_HOOKUP_OBJECT (mainwin, clear1, "clear1"); - GLADE_HOOKUP_OBJECT (mainwin, image559, "image559"); + GLADE_HOOKUP_OBJECT (mainwin, image567, "image567"); GLADE_HOOKUP_OBJECT (mainwin, select_all1, "select_all1"); GLADE_HOOKUP_OBJECT (mainwin, deselect_all1, "deselect_all1"); GLADE_HOOKUP_OBJECT (mainwin, invert_selection1, "invert_selection1"); GLADE_HOOKUP_OBJECT (mainwin, Selection, "Selection"); GLADE_HOOKUP_OBJECT (mainwin, Selection_menu, "Selection_menu"); GLADE_HOOKUP_OBJECT (mainwin, remove1, "remove1"); - GLADE_HOOKUP_OBJECT (mainwin, image560, "image560"); + GLADE_HOOKUP_OBJECT (mainwin, image568, "image568"); GLADE_HOOKUP_OBJECT (mainwin, crop1, "crop1"); GLADE_HOOKUP_OBJECT (mainwin, find1, "find1"); GLADE_HOOKUP_OBJECT (mainwin, sort_by1, "sort_by1"); @@ -828,6 +820,7 @@ create_mainwin (void) GLADE_HOOKUP_OBJECT (mainwin, view_headers, "view_headers"); GLADE_HOOKUP_OBJECT (mainwin, view_tabs, "view_tabs"); GLADE_HOOKUP_OBJECT (mainwin, view_eq, "view_eq"); + GLADE_HOOKUP_OBJECT (mainwin, design_mode1, "design_mode1"); GLADE_HOOKUP_OBJECT (mainwin, Playback, "Playback"); GLADE_HOOKUP_OBJECT (mainwin, Playback_menu, "Playback_menu"); GLADE_HOOKUP_OBJECT (mainwin, Order, "Order"); @@ -849,16 +842,16 @@ create_mainwin (void) GLADE_HOOKUP_OBJECT (mainwin, Help, "Help"); GLADE_HOOKUP_OBJECT (mainwin, Help_menu, "Help_menu"); GLADE_HOOKUP_OBJECT (mainwin, help1, "help1"); - GLADE_HOOKUP_OBJECT (mainwin, image561, "image561"); + GLADE_HOOKUP_OBJECT (mainwin, image569, "image569"); GLADE_HOOKUP_OBJECT (mainwin, changelog1, "changelog1"); GLADE_HOOKUP_OBJECT (mainwin, separator10, "separator10"); GLADE_HOOKUP_OBJECT (mainwin, gpl1, "gpl1"); GLADE_HOOKUP_OBJECT (mainwin, lgpl1, "lgpl1"); GLADE_HOOKUP_OBJECT (mainwin, separator9, "separator9"); GLADE_HOOKUP_OBJECT (mainwin, about1, "about1"); - GLADE_HOOKUP_OBJECT (mainwin, image562, "image562"); + GLADE_HOOKUP_OBJECT (mainwin, image570, "image570"); GLADE_HOOKUP_OBJECT (mainwin, translators1, "translators1"); - GLADE_HOOKUP_OBJECT (mainwin, image563, "image563"); + GLADE_HOOKUP_OBJECT (mainwin, image571, "image571"); GLADE_HOOKUP_OBJECT (mainwin, hbox2, "hbox2"); GLADE_HOOKUP_OBJECT (mainwin, hbox3, "hbox3"); GLADE_HOOKUP_OBJECT (mainwin, stopbtn, "stopbtn"); @@ -873,9 +866,6 @@ create_mainwin (void) GLADE_HOOKUP_OBJECT (mainwin, image5, "image5"); GLADE_HOOKUP_OBJECT (mainwin, seekbar, "seekbar"); GLADE_HOOKUP_OBJECT (mainwin, volumebar, "volumebar"); - GLADE_HOOKUP_OBJECT (mainwin, tabstrip, "tabstrip"); - GLADE_HOOKUP_OBJECT (mainwin, frame1, "frame1"); - GLADE_HOOKUP_OBJECT (mainwin, playlist, "playlist"); GLADE_HOOKUP_OBJECT (mainwin, plugins_bottom_vbox, "plugins_bottom_vbox"); GLADE_HOOKUP_OBJECT (mainwin, statusbar, "statusbar"); diff --git a/plugins/gtkui/mainplaylist.c b/plugins/gtkui/mainplaylist.c index f04f9cb1..78db579f 100644 --- a/plugins/gtkui/mainplaylist.c +++ b/plugins/gtkui/mainplaylist.c @@ -347,9 +347,6 @@ main_playlist_free (void) { void main_refresh (void) { - if (mainwin && gtk_widget_get_visible (mainwin)) { - DdbListview *pl = DDB_LISTVIEW (lookup_widget (mainwin, "playlist")); - ddb_listview_refresh (pl, DDB_REFRESH_VSCROLL | DDB_REFRESH_LIST); - } + deadbeef->sendmessage (DB_EV_PLAYLISTCHANGED, 0, 0, 0); } diff --git a/plugins/gtkui/mainplaylist.h b/plugins/gtkui/mainplaylist.h index b17ef63d..56a076c1 100644 --- a/plugins/gtkui/mainplaylist.h +++ b/plugins/gtkui/mainplaylist.h @@ -19,6 +19,8 @@ #ifndef __MAINPLAYLIST_H #define __MAINPLAYLIST_H +#include "ddblistview.h" + void main_playlist_init (GtkWidget *widget); @@ -31,4 +33,7 @@ main_refresh (void); int main_get_idx (DdbListviewIter it); +void +main_drag_n_drop (DdbListviewIter before, DdbPlaylistHandle from_playlist, uint32_t *indices, int length, int copy); + #endif diff --git a/plugins/gtkui/prefwin.c b/plugins/gtkui/prefwin.c index 4f6207f4..d2d09300 100644 --- a/plugins/gtkui/prefwin.c +++ b/plugins/gtkui/prefwin.c @@ -860,8 +860,9 @@ on_tabstrip_light_color_set (GtkColorButton *colorbutton, deadbeef->conf_set_str ("gtkui.color.tabstrip_light", str); deadbeef->sendmessage (DB_EV_CONFIGCHANGED, 0, 0, 0); gtkui_init_theme_colors (); - redraw_headers (); - tabstrip_redraw (); +// redraw_headers (); +// tabstrip_redraw (); + gtk_widget_queue_draw (mainwin); } @@ -876,8 +877,9 @@ on_tabstrip_mid_color_set (GtkColorButton *colorbutton, deadbeef->conf_set_str ("gtkui.color.tabstrip_mid", str); deadbeef->sendmessage (DB_EV_CONFIGCHANGED, 0, 0, 0); gtkui_init_theme_colors (); - redraw_headers (); - tabstrip_redraw (); +// redraw_headers (); +// tabstrip_redraw (); + gtk_widget_queue_draw (mainwin); } @@ -892,8 +894,9 @@ on_tabstrip_dark_color_set (GtkColorButton *colorbutton, deadbeef->conf_set_str ("gtkui.color.tabstrip_dark", str); deadbeef->sendmessage (DB_EV_CONFIGCHANGED, 0, 0, 0); gtkui_init_theme_colors (); - redraw_headers (); - tabstrip_redraw (); +// redraw_headers (); +// tabstrip_redraw (); + gtk_widget_queue_draw (mainwin); } void @@ -907,8 +910,9 @@ on_tabstrip_base_color_set (GtkColorButton *colorbutton, deadbeef->conf_set_str ("gtkui.color.tabstrip_base", str); deadbeef->sendmessage (DB_EV_CONFIGCHANGED, 0, 0, 0); gtkui_init_theme_colors (); - redraw_headers (); - tabstrip_redraw (); +// redraw_headers (); +// tabstrip_redraw (); + gtk_widget_queue_draw (mainwin); } void @@ -922,8 +926,9 @@ on_tabstrip_text_color_set (GtkColorButton *colorbutton, deadbeef->conf_set_str ("gtkui.color.tabstrip_text", str); deadbeef->sendmessage (DB_EV_CONFIGCHANGED, 0, 0, 0); gtkui_init_theme_colors (); - redraw_headers (); - tabstrip_redraw (); +// redraw_headers (); +// tabstrip_redraw (); + gtk_widget_queue_draw (mainwin); } void @@ -1084,8 +1089,9 @@ on_override_tabstrip_colors_toggled (GtkToggleButton *togglebutton, deadbeef->sendmessage (DB_EV_CONFIGCHANGED, 0, 0, 0); gtkui_init_theme_colors (); prefwin_init_theme_colors (); - redraw_headers (); - tabstrip_redraw (); +// redraw_headers (); +// tabstrip_redraw (); + gtk_widget_queue_draw (mainwin); } void diff --git a/plugins/gtkui/widgets.c b/plugins/gtkui/widgets.c new file mode 100644 index 00000000..327cfd7f --- /dev/null +++ b/plugins/gtkui/widgets.c @@ -0,0 +1,306 @@ +/* + DeaDBeeF - ultimate music player for GNU/Linux systems with X11 + Copyright (C) 2009-2011 Alexey Yakovenko <waker@users.sourceforge.net> + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +#include <stdlib.h> +#include <string.h> +#include "gtkui.h" +#include "widgets.h" +#include "ddbtabstrip.h" +#include "ddblistview.h" +#include "mainplaylist.h" + +typedef struct { + ddb_gtkui_widget_t base; +} w_splitter_t; + +typedef struct { + ddb_gtkui_widget_t base; +} w_box_t; + +typedef struct { + ddb_gtkui_widget_t base; +} w_tabstrip_t; + +typedef struct { + ddb_gtkui_widget_t base; + DdbTabStrip *tabstrip; + DdbListview *list; +} w_tabbed_playlist_t; + +typedef struct { + ddb_gtkui_widget_t base; +} w_playlist_t; + + +void +w_append (ddb_gtkui_widget_t *cont, ddb_gtkui_widget_t *child) { + child->next = cont->children; + cont->children = child; +} + +ddb_gtkui_widget_t * +w_create_hsplitter (void) { + w_splitter_t *w = malloc (sizeof (w_splitter_t)); + memset (w, 0, sizeof (w_splitter_t)); + w->base.widget = gtk_hpaned_new (); + return (ddb_gtkui_widget_t*)w; +} + +ddb_gtkui_widget_t * +w_create_vsplitter (void) { + w_splitter_t *w = malloc (sizeof (w_splitter_t)); + memset (w, 0, sizeof (w_splitter_t)); + w->base.widget = gtk_vpaned_new (); + return (ddb_gtkui_widget_t*)w; +} + +ddb_gtkui_widget_t * +w_create_box (void) { + w_box_t *w = malloc (sizeof (w_box_t)); + memset (w, 0, sizeof (w_box_t)); + w->base.widget = gtk_vbox_new (FALSE, 0); + return (ddb_gtkui_widget_t*)w; +} + +ddb_gtkui_widget_t * +w_create_tabstrip (void) { + w_tabstrip_t *w = malloc (sizeof (w_tabstrip_t)); + memset (w, 0, sizeof (w_tabstrip_t)); + w->base.widget = ddb_tabstrip_new (); + return (ddb_gtkui_widget_t*)w; +} + +typedef struct { + ddb_gtkui_widget_t *w; + DB_playItem_t *trk; +} w_trackdata_t; + +static gboolean +trackinfochanged_cb (gpointer p) { + w_trackdata_t *d = p; + w_tabbed_playlist_t *tp = (w_tabbed_playlist_t *)d->w; + ddb_playlist_t *plt = deadbeef->plt_get_curr (); + if (plt) { + int idx = deadbeef->plt_get_item_idx (plt, (DB_playItem_t *)d->trk, PL_MAIN); + if (idx != -1) { + ddb_listview_draw_row (tp->list, idx, (DdbListviewIter)d->trk); + } + deadbeef->plt_unref (plt); + } + deadbeef->pl_item_unref (d->trk); + free (d); + return FALSE; +} + +static gboolean +paused_cb (gpointer p) { + w_tabbed_playlist_t *tp = (w_tabbed_playlist_t *)p; + DB_playItem_t *curr = deadbeef->streamer_get_playing_track (); + if (curr) { + int idx = deadbeef->pl_get_idx_of (curr); + ddb_listview_draw_row (tp->list, idx, (DdbListviewIter)curr); + deadbeef->pl_item_unref (curr); + } + return FALSE; +} + +static gboolean +refresh_cb (gpointer p) { + w_tabbed_playlist_t *tp = (w_tabbed_playlist_t *)p; + ddb_listview_clear_sort (tp->list); + ddb_listview_refresh (tp->list, DDB_REFRESH_LIST | DDB_REFRESH_VSCROLL); + return FALSE; +} + + +static gboolean +playlistswitch_cb (gpointer p) { + w_tabbed_playlist_t *tp = (w_tabbed_playlist_t *)p; + int curr = deadbeef->plt_get_curr_idx (); + char conf[100]; + snprintf (conf, sizeof (conf), "playlist.scroll.%d", curr); + int scroll = deadbeef->conf_get_int (conf, 0); + snprintf (conf, sizeof (conf), "playlist.cursor.%d", curr); + int cursor = deadbeef->conf_get_int (conf, -1); + ddb_tabstrip_refresh (tp->tabstrip); + deadbeef->pl_set_cursor (PL_MAIN, cursor); + if (cursor != -1) { + DB_playItem_t *it = deadbeef->pl_get_for_idx_and_iter (cursor, PL_MAIN); + if (it) { + deadbeef->pl_set_selected (it, 1); + deadbeef->pl_item_unref (it); + } + } + + ddb_listview_refresh (tp->list, DDB_LIST_CHANGED | DDB_REFRESH_LIST | DDB_REFRESH_VSCROLL); + ddb_listview_set_vscroll (tp->list, scroll); + return FALSE; +} + +struct fromto_t { + ddb_gtkui_widget_t *w; + DB_playItem_t *from; + DB_playItem_t *to; +}; + +static gboolean +songchanged_cb (gpointer p) { + struct fromto_t *ft = p; + DB_playItem_t *from = ft->from; + DB_playItem_t *to = ft->to; + w_tabbed_playlist_t *tp = (w_tabbed_playlist_t *)ft->w; + int to_idx = -1; + if (!ddb_listview_is_scrolling (tp->list) && to) { + int cursor_follows_playback = deadbeef->conf_get_int ("playlist.scroll.cursorfollowplayback", 0); + int scroll_follows_playback = deadbeef->conf_get_int ("playlist.scroll.followplayback", 0); + int plt = deadbeef->streamer_get_current_playlist (); + if (plt != -1) { + if (cursor_follows_playback && plt != deadbeef->plt_get_curr_idx ()) { + deadbeef->plt_set_curr_idx (plt); + } + to_idx = deadbeef->pl_get_idx_of (to); + if (to_idx != -1) { + if (cursor_follows_playback) { + ddb_listview_set_cursor_noscroll (tp->list, to_idx); + } + if (scroll_follows_playback && plt == deadbeef->plt_get_curr_idx ()) { + ddb_listview_scroll_to (tp->list, to_idx); + } + } + } + } + + if (from) { + int idx = deadbeef->pl_get_idx_of (from); + if (idx != -1) { + ddb_listview_draw_row (tp->list, idx, from); + } + } + if (to && to_idx != -1) { + ddb_listview_draw_row (tp->list, to_idx, to); + } + if (ft->from) { + deadbeef->pl_item_unref (ft->from); + } + if (ft->to) { + deadbeef->pl_item_unref (ft->to); + } + free (ft); + return FALSE; +} + +static int +w_tabbed_playlist_message (ddb_gtkui_widget_t *w, uint32_t id, uintptr_t ctx, uint32_t p1, uint32_t p2) { + w_tabbed_playlist_t *tp = (w_tabbed_playlist_t *)w; + switch (id) { + case DB_EV_SONGCHANGED: + g_idle_add (redraw_queued_tracks_cb, tp->list); + ddb_event_trackchange_t *ev = (ddb_event_trackchange_t *)ctx; + struct fromto_t *ft = malloc (sizeof (struct fromto_t)); + ft->from = ev->from; + ft->to = ev->to; + if (ft->from) { + deadbeef->pl_item_ref (ft->from); + } + if (ft->to) { + deadbeef->pl_item_ref (ft->to); + } + ft->w = w; + g_idle_add (songchanged_cb, ft); + break; + case DB_EV_TRACKINFOCHANGED: + { + ddb_event_track_t *ev = (ddb_event_track_t *)ctx; + if (ev->track) { + deadbeef->pl_item_ref (ev->track); + } + w_trackdata_t *d = malloc (sizeof (w_trackdata_t)); + memset (d, 0, sizeof (w_trackdata_t)); + d->w = w; + d->trk = ev->track; + g_idle_add (trackinfochanged_cb, d); + } + break; + case DB_EV_PAUSED: + g_idle_add (paused_cb, w); + break; + case DB_EV_PLAYLISTCHANGED: + g_idle_add (refresh_cb, w); + break; + case DB_EV_PLAYLISTSWITCHED: + g_idle_add (playlistswitch_cb, w); + break; + } + return 0; +} + +static void +w_tabbed_playlist_destroy (ddb_gtkui_widget_t *w) { + w_tabbed_playlist_t *tp = (w_tabbed_playlist_t *)w; + gtk_widget_destroy (tp->base.widget); + free (tp); +} + +ddb_gtkui_widget_t * +w_tabbed_playlist_create (void) { + w_tabbed_playlist_t *w = malloc (sizeof (w_tabbed_playlist_t)); + memset (w, 0, sizeof (w_tabbed_playlist_t)); + + w->base.widget = gtk_vbox_new (FALSE, 0); + + GtkWidget *tabstrip = ddb_tabstrip_new (); + w->tabstrip = (DdbTabStrip *)tabstrip; + gtk_widget_show (tabstrip); + GtkWidget *list = ddb_listview_new (); + w->list = (DdbListview *)list; + gtk_widget_show (list); + GtkWidget *frame = gtk_frame_new (NULL); + gtk_widget_show (frame); + + gtk_box_pack_start (GTK_BOX (w->base.widget), tabstrip, FALSE, TRUE, 0); + gtk_widget_set_size_request (tabstrip, -1, 24); + GTK_WIDGET_UNSET_FLAGS (tabstrip, GTK_CAN_FOCUS); + GTK_WIDGET_UNSET_FLAGS (tabstrip, GTK_CAN_DEFAULT); + + gtk_box_pack_start (GTK_BOX (w->base.widget), frame, TRUE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (frame), 1); + + gtk_container_add (GTK_CONTAINER (frame), list); + GTK_WIDGET_UNSET_FLAGS (list, GTK_CAN_FOCUS); + GTK_WIDGET_UNSET_FLAGS (list, GTK_CAN_DEFAULT); + main_playlist_init (list); + if (deadbeef->conf_get_int ("gtkui.headers.visible", 1)) { + ddb_listview_show_header (w->list, 1); + } + else { + ddb_listview_show_header (w->list, 0); + } + + w->base.message = w_tabbed_playlist_message; + w->base.destroy = w_tabbed_playlist_destroy; + return (ddb_gtkui_widget_t*)w; +} + +ddb_gtkui_widget_t * +w_create_playlist (void) { + w_playlist_t *w = malloc (sizeof (w_playlist_t)); + memset (w, 0, sizeof (w_playlist_t)); + w->base.widget = ddb_listview_new (); + return (ddb_gtkui_widget_t*)w; +} diff --git a/plugins/gtkui/widgets.h b/plugins/gtkui/widgets.h new file mode 100644 index 00000000..e4d8c734 --- /dev/null +++ b/plugins/gtkui/widgets.h @@ -0,0 +1,44 @@ +/* + DeaDBeeF - ultimate music player for GNU/Linux systems with X11 + Copyright (C) 2009-2011 Alexey Yakovenko <waker@users.sourceforge.net> + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ +#ifndef __WIDGETS_H +#define __WIDGETS_H + +#include "gtkui_api.h" + +void +w_append (ddb_gtkui_widget_t *cont, ddb_gtkui_widget_t *child); + +ddb_gtkui_widget_t * +w_create_hsplitter (void); + +ddb_gtkui_widget_t * +w_create_vsplitter (void); + +ddb_gtkui_widget_t * +w_create_box (void); + +ddb_gtkui_widget_t * +w_create_tabstrip (void); + +ddb_gtkui_widget_t * +w_tabbed_playlist_create (void); + +ddb_gtkui_widget_t * +w_create_playlist (void); +#endif |