[beast/devel: 2/4] BST: turn all beast-gtk sources into C++
- From: Tim Janik <timj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [beast/devel: 2/4] BST: turn all beast-gtk sources into C++
- Date: Fri, 21 Dec 2012 02:45:03 +0000 (UTC)
commit 2ca978e1c8ca12867408483dce3cbb87daf30237
Author: Tim Janik <timj gnu org>
Date: Fri Dec 21 03:21:35 2012 +0100
BST: turn all beast-gtk sources into C++
BST: turn generated sources into C++
BST: compile most files as C++
beast-gtk/Makefile.am | 60 ++++----
beast-gtk/{bstapp.c => bstapp.cc} | 106 +++++++-------
beast-gtk/{bstasciipixbuf.c => bstasciipixbuf.cc} | 5 +-
beast-gtk/{bstauxdialogs.c => bstauxdialogs.cc} | 59 ++++----
beast-gtk/{bstbseutils.c => bstbseutils.cc} | 0
beast-gtk/{bstbuseditor.c => bstbuseditor.cc} | 16 +-
beast-gtk/{bstbusmixer.c => bstbusmixer.cc} | 10 +-
beast-gtk/{bstbusview.c => bstbusview.cc} | 8 +-
beast-gtk/{bstcanvaslink.c => bstcanvaslink.cc} | 108 ++++++++-------
.../{bstcanvassource.c => bstcanvassource.cc} | 112 +++++++-------
beast-gtk/{bstcluehunter.c => bstcluehunter.cc} | 123 ++++++++--------
beast-gtk/{bstdbmeter.c => bstdbmeter.cc} | 143 +++++++++---------
beast-gtk/{bstdial.c => bstdial.cc} | 16 +-
beast-gtk/{bsteffectview.c => bsteffectview.cc} | 10 +-
beast-gtk/{bsteventroll.c => bsteventroll.cc} | 50 +++----
beast-gtk/bsteventroll.h | 5 +-
.../{bsteventrollctrl.c => bsteventrollctrl.cc} | 6 +-
beast-gtk/{bstfiledialog.c => bstfiledialog.cc} | 153 ++++++++++----------
beast-gtk/bstfiledialog.h | 9 ++
beast-gtk/{bstgconfig.c => bstgconfig.cc} | 8 +-
beast-gtk/{bstgrowbar.c => bstgrowbar.cc} | 54 ++++----
.../{bstitemseqdialog.c => bstitemseqdialog.cc} | 32 ++--
beast-gtk/{bstitemview.c => bstitemview.cc} | 28 ++--
beast-gtk/{bstkeybindings.c => bstkeybindings.cc} | 64 ++++----
beast-gtk/bstkeybindings.h | 4 +-
beast-gtk/{bstknob.c => bstknob.cc} | 8 +-
.../{bstlogadjustment.c => bstlogadjustment.cc} | 12 +-
beast-gtk/{bstmain.c => bstmain.cc} | 24 ++--
beast-gtk/{bstmenus.c => bstmenus.cc} | 32 ++---
beast-gtk/bstmenus.h | 23 ++-
beast-gtk/{bstmsgabsorb.c => bstmsgabsorb.cc} | 20 ++--
...stparam-automation.c => bstparam-automation.cc} | 56 ++++----
.../{bstparam-choice.c => bstparam-choice.cc} | 26 ++--
...m-color-spinner.c => bstparam-color-spinner.cc} | 4 +-
.../{bstparam-item-seq.c => bstparam-item-seq.cc} | 24 ++--
...m-note-sequence.c => bstparam-note-sequence.cc} | 2 +-
...ram-note-spinner.c => bstparam-note-spinner.cc} | 0
beast-gtk/{bstparam-proxy.c => bstparam-proxy.cc} | 20 ++--
beast-gtk/{bstparam-scale.c => bstparam-scale.cc} | 4 +-
...stparam-searchpath.c => bstparam-searchpath.cc} | 12 +-
beast-gtk/{bstparam-time.c => bstparam-time.cc} | 10 +-
beast-gtk/{bstparam.c => bstparam.cc} | 75 +++++-----
beast-gtk/{bstparamview.c => bstparamview.cc} | 26 ++--
beast-gtk/{bstpartdialog.c => bstpartdialog.cc} | 30 ++--
beast-gtk/{bstpartview.c => bstpartview.cc} | 10 +-
.../{bstpatterncolumns.c => bstpatterncolumns.cc} | 107 +++++++-------
beast-gtk/bstpatterncolumns.h | 92 +++++++-----
beast-gtk/{bstpatternctrl.c => bstpatternctrl.cc} | 96 ++++++++-----
beast-gtk/{bstpatternview.c => bstpatternview.cc} | 69 ++++-----
beast-gtk/bstpatternview.h | 16 +--
beast-gtk/{bstpianoroll.c => bstpianoroll.cc} | 65 ++++-----
beast-gtk/bstpianoroll.h | 8 +-
.../{bstpianorollctrl.c => bstpianorollctrl.cc} | 19 ++--
beast-gtk/{bstplayback.c => bstplayback.cc} | 2 +-
beast-gtk/{bstplaylist.c => bstplaylist.cc} | 12 +-
beast-gtk/{bstpreferences.c => bstpreferences.cc} | 56 ++++----
beast-gtk/{bstprocbrowser.c => bstprocbrowser.cc} | 10 +-
beast-gtk/{bstprocedure.c => bstprocedure.cc} | 38 +++---
beast-gtk/{bstprofiler.c => bstprofiler.cc} | 32 +++--
beast-gtk/{bstprojectctrl.c => bstprojectctrl.cc} | 56 ++++----
beast-gtk/{bstqsampler.c => bstqsampler.cc} | 27 ++--
beast-gtk/bstqsampler.h | 8 +
...rackeditor-covers.c => bstrackeditor-covers.cc} | 8 +-
beast-gtk/{bstrackeditor.c => bstrackeditor.cc} | 57 ++++----
beast-gtk/{bstrackitem.c => bstrackitem.cc} | 16 +--
beast-gtk/{bstracktable.c => bstracktable.cc} | 86 ++++++------
beast-gtk/{bstrackview.c => bstrackview.cc} | 24 ++--
beast-gtk/{bstrtest.c => bstrtest.cc} | 4 +-
.../{bstsampleeditor.c => bstsampleeditor.cc} | 81 +++++------
beast-gtk/{bstscrollgraph.c => bstscrollgraph.cc} | 40 +++---
beast-gtk/{bstsegment.c => bstsegment.cc} | 2 +-
beast-gtk/{bstsequence.c => bstsequence.cc} | 28 ++--
.../{bstservermonitor.c => bstservermonitor.cc} | 8 +-
beast-gtk/{bstskinconfig.c => bstskinconfig.cc} | 16 ++-
beast-gtk/{bstsnetrouter.c => bstsnetrouter.cc} | 118 +++++++--------
.../{bstsnifferscope.c => bstsnifferscope.cc} | 10 +-
beast-gtk/{bstsplash.c => bstsplash.cc} | 92 ++++++------
beast-gtk/{bststest.c => bststest.cc} | 0
beast-gtk/{bstsupershell.c => bstsupershell.cc} | 10 +-
beast-gtk/{bsttrackroll.c => bsttrackroll.cc} | 55 ++++----
.../{bsttrackrollctrl.c => bsttrackrollctrl.cc} | 7 +-
...sttracksynthdialog.c => bsttracksynthdialog.cc} | 74 +++++-----
beast-gtk/{bsttrackview.c => bsttrackview.cc} | 60 ++++----
beast-gtk/{bsttreestores.c => bsttreestores.cc} | 75 +++++-----
beast-gtk/{bstusermessage.c => bstusermessage.cc} | 90 ++++++------
beast-gtk/bstusermessage.h | 4 +-
beast-gtk/{bstutils.c => bstutils.cc} | 89 ++++++------
beast-gtk/{bstwaveeditor.c => bstwaveeditor.cc} | 129 ++++++++---------
beast-gtk/{bstwaveview.c => bstwaveview.cc} | 9 +-
beast-gtk/{bstxframe.c => bstxframe.cc} | 22 ++--
beast-gtk/{bstxkb.c => bstxkb.cc} | 2 +-
.../{bstzoomedwindow.c => bstzoomedwindow.cc} | 27 ++--
beast-gtk/gxk/gxkdialog.h | 7 +-
beast-gtk/gxk/gxkglobals.h | 6 +
beast-gtk/gxk/gxktexttools.h | 9 ++
beast-gtk/{testgui.c => testgui.cc} | 25 ++--
beast-gtk/{tsmview.c => tsmview.cc} | 16 +-
po/POTSCAN | 103 +++++++-------
98 files changed, 1891 insertions(+), 1838 deletions(-)
---
diff --git a/beast-gtk/Makefile.am b/beast-gtk/Makefile.am
index 1f6fbaa..23ac8ff 100644
--- a/beast-gtk/Makefile.am
+++ b/beast-gtk/Makefile.am
@@ -44,33 +44,33 @@ beast_headers = $(strip \
EXTRA_DIST += $(beast_headers)
# BEAST sources to build the program from
beast_sources = $(strip \
- bsttrackrollctrl.c bstxframe.c bstscrollgraph.c \
- bstdbmeter.c bstbusmixer.c bstbuseditor.c bstitemseqdialog.c \
- bstcanvassource.c bstapp.c bstasciipixbuf.c bstcanvaslink.c \
- bstpatterncolumns.c bstxkb.c bstpatternview.c bstpatternctrl.c \
- bstkeybindings.c bstprofiler.c bstgrowbar.c bstbusview.c \
- bstpianorollctrl.c bstpartview.c bstpianoroll.c bstplayback.c \
- bsttrackroll.c bstcluehunter.c bstprojectctrl.c bstcxxutils.cc \
- bstauxdialogs.c bstsegment.c bsteventrollctrl.c bsteventroll.c \
- bstsnifferscope.c bstwaveview.c bstfiledialog.c bstgconfig.c \
- bstlogadjustment.c bstitemview.c bstservermonitor.c bstknob.c \
- bstparamview.c bstmenus.c bstparam.c bstpartdialog.c \
- bstprocbrowser.c bstqsampler.c bstpreferences.c bstprocedure.c \
- bstrackeditor.c bstrackitem.c bstracktable.c bstsequence.c \
- bstsnetrouter.c bstsplash.c bsttrackview.c bstsupershell.c \
- bstusermessage.c bstdial.c bsttracksynthdialog.c bstwaveeditor.c \
- bstzoomedwindow.c bstskinconfig.c bstmsgabsorb.c bstsampleeditor.c \
- bstrackview.c bsttreestores.c bstbseutils.c bstutils.c \
+ bsttrackrollctrl.cc bstxframe.cc bstscrollgraph.cc \
+ bstdbmeter.cc bstbusmixer.cc bstbuseditor.cc bstitemseqdialog.cc \
+ bstcanvassource.c bstapp.cc bstasciipixbuf.cc bstcanvaslink.cc \
+ bstpatterncolumns.cc bstxkb.cc bstpatternview.cc bstpatternctrl.cc \
+ bstkeybindings.cc bstprofiler.cc bstgrowbar.cc bstbusview.cc \
+ bstpianorollctrl.cc bstpartview.cc bstpianoroll.cc bstplayback.cc \
+ bsttrackroll.cc bstcluehunter.cc bstprojectctrl.cc bstcxxutils.cc \
+ bstauxdialogs.cc bstsegment.cc bsteventrollctrl.cc bsteventroll.cc \
+ bstsnifferscope.cc bstwaveview.cc bstfiledialog.cc bstgconfig.cc \
+ bstlogadjustment.cc bstitemview.cc bstservermonitor.cc bstknob.cc \
+ bstparamview.cc bstmenus.cc bstparam.cc bstpartdialog.cc \
+ bstprocbrowser.cc bstqsampler.cc bstpreferences.cc bstprocedure.cc \
+ bstrackeditor.cc bstrackitem.cc bstracktable.cc bstsequence.cc \
+ bstsnetrouter.cc bstsplash.cc bsttrackview.cc bstsupershell.cc \
+ bstusermessage.cc bstdial.cc bsttracksynthdialog.cc bstwaveeditor.cc \
+ bstzoomedwindow.cc bstskinconfig.cc bstmsgabsorb.cc bstsampleeditor.cc \
+ bstrackview.cc bsttreestores.cc bstbseutils.cc bstutils.cc \
$(PROFILE_SOURCE) \
)
# BEAST sources that get included (don't have own .lo rules)
beast_extra_files = $(strip \
- bstparam-automation.c \
- bstparam-choice.c bstparam-note-sequence.c \
- bstparam-note-spinner.c bstparam-proxy.c \
- bstparam-color-spinner.c bstparam-scale.c \
- bstparam-searchpath.c bstparam-time.c \
- bstparam-item-seq.c bstrackeditor-covers.c \
+ bstparam-automation.cc \
+ bstparam-choice.cc bstparam-note-sequence.cc \
+ bstparam-note-spinner.cc bstparam-proxy.cc \
+ bstparam-color-spinner.cc bstparam-scale.cc \
+ bstparam-searchpath.cc bstparam-time.cc \
+ bstparam-item-seq.cc bstrackeditor-covers.cc \
\
bstmarshal.list bstrecords.idl \
)
@@ -90,12 +90,14 @@ $(beast_vOBJECTS): bstgentypes.h
bstgentypes.h: stamp-bstgentypes.h ;
stamp-bstgentypes.h: $(beast_headers) $(srcdir)/bstrecords.idl $(SFIDL)
cd . \
+ && echo 'G_BEGIN_DECLS;' > xgen-$(@F) \
&& ( cd $(srcdir) && $(GLIB_MKENUMS) \
--fprod "\n/* --- @filename@ --- */" \
--eprod "#define BST_TYPE_ ENUMSHORT@\t (bst__type_id__ EnumName@)\n" \
--eprod "extern GType bst__type_id__ EnumName@;" \
- $(beast_headers) ) > xgen-$(@F) \
- && $(SFIDL) --host-c --header ${srcdir}/bstrecords.idl >> xgen-$(@F) \
+ $(beast_headers) ) >> xgen-$(@F) \
+ && $(SFIDL) --host-c --header ${srcdir}/bstrecords.idl >> xgen-$(@F) \
+ && echo 'G_END_DECLS;' >> xgen-$(@F) \
&& (cmp -s xgen-$(@F) bstgentypes.h || cp xgen-$(@F) bstgentypes.h) \
&& rm -f xgen-$(@F) \
&& echo timestamp > $@
@@ -164,7 +166,7 @@ bstmarshal.h: bstmarshal.list
&& rm -f xgen-$(@F)
# bstmarshal.c
GENERATED_CLEANFILES += bstmarshal.c
-$(srcdir)/bstutils.c: bstmarshal.c
+$(srcdir)/bstutils.cc: bstmarshal.c
bstmarshal.c: bstmarshal.list
glib-genmarshal --prefix=bst_marshal $(srcdir)/bstmarshal.list --body > xgen-$(@F) \
&& cp xgen-$(@F) $@ \
@@ -184,7 +186,7 @@ generated: clean-generated $(GENERATED)
# build rules for programs
#
bin_PROGRAMS = beast-$(BIN_VERSION)
-beast___BIN_VERSION__SOURCES = bstmain.c $(beast_sources)
+beast___BIN_VERSION__SOURCES = bstmain.cc $(beast_sources)
beast___BIN_VERSION__LDADD = $(progs_LDADD)
beast_vOBJECTS = $(beast___BIN_VERSION__OBJECTS)
noinst_PROGRAMS = $(ALLTESTS)
@@ -195,9 +197,9 @@ progs_LDADD = $(strip \
)
noinst_PROGRAMS += tsmview
-tsmview_SOURCES = tsmview.c cxxdummy.cc
+tsmview_SOURCES = tsmview.cc cxxdummy.cc
tsmview_LDADD = $(progs_LDADD)
noinst_PROGRAMS += testgui
-testgui_SOURCES = testgui.c $(beast_sources)
+testgui_SOURCES = testgui.cc $(beast_sources)
testgui_LDADD = $(progs_LDADD)
diff --git a/beast-gtk/bstapp.c b/beast-gtk/bstapp.cc
similarity index 92%
rename from beast-gtk/bstapp.c
rename to beast-gtk/bstapp.cc
index 43f37d5..bfd5b9e 100644
--- a/beast-gtk/bstapp.c
+++ b/beast-gtk/bstapp.cc
@@ -239,7 +239,7 @@ bst_app_init (BstApp *self)
NULL);
bst_app_register (self);
self->box = gxk_radget_create ("beast", "application-box", NULL);
- gtk_container_add (GTK_CONTAINER (GXK_DIALOG (self)->vbox), self->box);
+ gtk_container_add (GTK_CONTAINER (GXK_DIALOG (self)->vbox), (GtkWidget*) self->box);
/* publish widget specific actions */
gxk_widget_publish_actions (self, "file-open", G_N_ELEMENTS (file_open_actions), file_open_actions,
@@ -309,7 +309,7 @@ bst_app_init (BstApp *self)
gxk_widget_publish_action_list (widget, "skin-options", al1);
/* setup playback controls */
- self->pcontrols = g_object_new (BST_TYPE_PROJECT_CTRL, NULL);
+ self->pcontrols = (GtkWidget*) g_object_new (BST_TYPE_PROJECT_CTRL, NULL);
gxk_radget_add (self->box, "control-area", self->pcontrols);
/* setup project pages */
@@ -330,7 +330,7 @@ bst_app_init (BstApp *self)
gxk_param_update (self->wave_file);
/* setup the main notebook */
- self->notebook = gxk_radget_find (self->box, "main-notebook");
+ self->notebook = (GtkNotebook*) gxk_radget_find (self->box, "main-notebook");
gxk_nullify_in_object (self, &self->notebook);
g_object_connect (self->notebook,
"swapped_signal_after::switch-page", gxk_widget_update_actions, self,
@@ -408,7 +408,7 @@ bst_app_new (SfiProxy project)
{
g_return_val_if_fail (BSE_IS_PROJECT (project), NULL);
- BstApp *self = g_object_new (BST_TYPE_APP, NULL);
+ BstApp *self = (BstApp*) g_object_new (BST_TYPE_APP, NULL);
gxk_dialog_set_sizes (GXK_DIALOG (self), 500, 400, 950, 800);
self->project = project;
@@ -441,7 +441,7 @@ bst_app_find (SfiProxy project)
for (slist = bst_app_class->apps; slist; slist = slist->next)
{
- BstApp *app = slist->data;
+ BstApp *app = (BstApp*) slist->data;
if (app->project == project)
return app;
@@ -539,7 +539,7 @@ bst_app_add_page_item (BstApp *self,
GtkWidget *page = NULL;
if (BSE_IS_SUPER (item))
{
- page = g_object_new (BST_TYPE_SUPER_SHELL, "super", item, NULL);
+ page = (GtkWidget*) g_object_new (BST_TYPE_SUPER_SHELL, "super", item, NULL);
g_object_ref (page);
gtk_object_sink (GTK_OBJECT (page));
}
@@ -554,8 +554,8 @@ proxyp_cmp_items (gconstpointer v1,
gconstpointer v2,
gpointer data)
{
- const SfiProxy *p1 = v1;
- const SfiProxy *p2 = v2;
+ const SfiProxy *p1 = (const SfiProxy*) v1;
+ const SfiProxy *p2 = (const SfiProxy*) v2;
if (*p1 == *p2)
return 0;
return proxy_rate_item (*p1) - proxy_rate_item (*p2);
@@ -586,10 +586,10 @@ bst_app_reload_pages (BstApp *self)
GSList *slist;
for (slist = self->ppages->entries; slist; slist = slist->next)
{
- GxkAssortmentEntry *entry = slist->data;
+ GxkAssortmentEntry *entry = (GxkAssortmentEntry*) slist->data;
for (ring = proxies; ring; ring = sfi_ring_next (ring, proxies))
{
- SfiProxy *pp = ring->data, item = *pp;
+ SfiProxy *pp = (SfiProxy*) ring->data, item = *pp;
if (item == (SfiProxy) entry->user_data)
break;
}
@@ -598,7 +598,7 @@ bst_app_reload_pages (BstApp *self)
}
while (outdated)
{
- GxkAssortmentEntry *entry = sfi_ring_pop_head (&outdated);
+ GxkAssortmentEntry *entry = (GxkAssortmentEntry*) sfi_ring_pop_head (&outdated);
gxk_assortment_remove (self->ppages, entry);
}
@@ -607,7 +607,7 @@ bst_app_reload_pages (BstApp *self)
i = 0;
for (ring = proxies; ring; ring = sfi_ring_next (ring, proxies), i++)
{
- SfiProxy *pp = ring->data, item = *pp;
+ SfiProxy *pp = (SfiProxy*) ring->data, item = *pp;
if (!gxk_assortment_find_data (self->ppages, (void*) item))
{
bst_app_add_page_item (self, i, item);
@@ -643,15 +643,15 @@ bst_app_handle_delete_event (GtkWidget *widget,
BstApp *self = BST_APP (widget);
if (bse_project_is_dirty (self->project))
{
- guint result = bst_msg_dialog (BST_MSG_WARNING,
- BST_MSG_TITLE (_("Close %s"), bse_item_get_name (self->project)),
- BST_MSG_TEXT1 (_("The project has been modified.")),
- BST_MSG_TEXT2 (_("Changes were made to project \"%s\" since the last time it was saved to disk."),
- bse_item_get_name (self->project)),
- BST_MSG_TEXT2 (_("Save the project before closing its window?")),
- BST_MSG_CHOICE (2, _("Save Changes"), BST_STOCK_SAVE),
- BST_MSG_CHOICE (1, _("Discard Changes"), BST_STOCK_DELETE),
- BST_MSG_CHOICE_D (0, _("Cancel"), BST_STOCK_CANCEL));
+ uint result = bst_msg_dialog (BST_MSG_WARNING,
+ BST_MSG_TITLE (_("Close %s"), bse_item_get_name (self->project)),
+ BST_MSG_TEXT1 (_("The project has been modified.")),
+ BST_MSG_TEXT2 (_("Changes were made to project \"%s\" since the last time it was saved to disk."),
+ bse_item_get_name (self->project)),
+ BST_MSG_TEXT2 (_("Save the project before closing its window?")),
+ BST_MSG_CHOICE (2, _("Save Changes"), BST_STOCK_SAVE),
+ BST_MSG_CHOICE (1, _("Discard Changes"), BST_STOCK_DELETE),
+ BST_MSG_CHOICE_D (0, _("Cancel"), BST_STOCK_CANCEL));
if (result == 1)
gtk_widget_destroy (widget);
else if (result == 2)
@@ -692,8 +692,8 @@ static int
demo_entries_compare (const void *v1,
const void *v2)
{
- const DemoEntry *d1 = v1;
- const DemoEntry *d2 = v2;
+ const DemoEntry *d1 = (const DemoEntry*) v1;
+ const DemoEntry *d2 = (const DemoEntry*) v2;
return strcmp (d1->file, d2->file);
}
@@ -702,11 +702,11 @@ demo_entries_setup (void)
{
if (!demo_entries)
{
- SfiRing *files = sfi_file_crawler_list_files (bse_server_get_demo_path (BSE_SERVER), "*.bse", 0);
+ SfiRing *files = sfi_file_crawler_list_files (bse_server_get_demo_path (BSE_SERVER), "*.bse", GFileTest (0));
while (files)
{
- gchar *file = sfi_ring_pop_head (&files);
- gchar *name = bst_file_scan_find_key (file, "container-child", "BseSong::");
+ char *file = (char*) sfi_ring_pop_head (&files);
+ char *name = bst_file_scan_find_key (file, "container-child", "BseSong::");
if (!name)
name = bst_file_scan_find_key (file, "container-child", "BseMidiSynth::"); // FIXME
if (!name)
@@ -772,12 +772,12 @@ skin_entries_setup (void)
if (!skin_entries)
{
gchar *skindirs = BST_STRDUP_SKIN_PATH ();
- SfiRing *files = sfi_file_crawler_list_files (skindirs, "*.skin", 0);
+ SfiRing *files = sfi_file_crawler_list_files (skindirs, "*.skin", GFileTest (0));
g_free (skindirs);
while (files)
{
- gchar *file = sfi_ring_pop_head (&files);
- gchar *name = bst_file_scan_find_key (file, "skin-name", "");
+ char *file = (char*) sfi_ring_pop_head (&files);
+ char *name = bst_file_scan_find_key (file, "skin-name", "");
static guint statici = 1;
if (!name)
name = g_strdup_printf ("skin-%u", statici++);
@@ -870,14 +870,14 @@ app_action_exec (gpointer data,
{
SfiProxy proxy;
GtkWidget *any;
- guint demo_type;
+ BstMsgType demo_type;
case BST_ACTION_EXIT:
if (bst_app_class)
{
GSList *slist, *free_slist = g_slist_copy (bst_app_class->apps);
for (slist = free_slist; slist; slist = slist->next)
- gxk_toplevel_delete (slist->data);
+ gxk_toplevel_delete ((GtkWidget*) slist->data);
g_slist_free (free_slist);
}
break;
@@ -965,31 +965,31 @@ app_action_exec (gpointer data,
case ACTION_RACK_EDITOR:
if (!self->rack_dialog)
{
- BstRackEditor *ed = g_object_new (BST_TYPE_RACK_EDITOR,
+ BstRackEditor *ed = (BstRackEditor*) g_object_new (BST_TYPE_RACK_EDITOR,
"visible", TRUE,
NULL);
- self->rack_editor = g_object_connect (ed, "swapped_signal::destroy", g_nullify_pointer, &self->rack_editor, NULL);
+ self->rack_editor = (GtkWidget*) g_object_connect (ed, "swapped_signal::destroy", g_nullify_pointer, &self->rack_editor, NULL);
bst_rack_editor_set_rack_view (ed, bse_project_get_data_pocket (self->project, "BEAST-Rack-View"));
- self->rack_dialog = gxk_dialog_new (&self->rack_dialog,
- GTK_OBJECT (self),
- 0, // FIXME: undo Edit when hide && GXK_DIALOG_HIDE_ON_DELETE
- _("Rack editor"),
- self->rack_editor);
+ self->rack_dialog = (GtkWidget*) gxk_dialog_new (&self->rack_dialog,
+ GTK_OBJECT (self),
+ GxkDialogFlags (0), // FIXME: undo Edit when hide && GXK_DIALOG_HIDE_ON_DELETE
+ _("Rack editor"),
+ self->rack_editor);
}
gxk_widget_showraise (self->rack_dialog);
break;
case ACTION_SHOW_PREFERENCES:
if (!bst_preferences)
{
- GtkWidget *widget = g_object_new (BST_TYPE_PREFERENCES,
- "visible", TRUE,
- NULL);
- bst_preferences = gxk_dialog_new (&bst_preferences,
- NULL,
- GXK_DIALOG_HIDE_ON_DELETE,
- _("Preferences"),
- widget);
+ GtkWidget *widget = (GtkWidget*) g_object_new (BST_TYPE_PREFERENCES,
+ "visible", TRUE,
+ NULL);
+ bst_preferences = (GtkWidget*) gxk_dialog_new (&bst_preferences,
+ NULL,
+ GXK_DIALOG_HIDE_ON_DELETE,
+ _("Preferences"),
+ widget);
bst_preferences_create_buttons (BST_PREFERENCES (widget), GXK_DIALOG (bst_preferences));
}
if (!GTK_WIDGET_VISIBLE (bst_preferences))
@@ -1135,7 +1135,7 @@ app_action_exec (gpointer data,
"fired up for pure demonstration purposes. This is such a dialog, so if you "
"are currently looking at a prominent warning or error message, there's no "
"real merit to it."),
- BST_MSG_TEXT3 ("Demo-Dialog-Type: %s", sfi_msg_type_label (demo_type)));
+ BST_MSG_TEXT3 ("Demo-Dialog-Type: %s", sfi_msg_type_label (SfiMsgType (demo_type))));
break;
default:
g_assert_not_reached ();
@@ -1244,13 +1244,13 @@ app_action_check (gpointer data,
}
static void
-bst_app_class_init (BstAppClass *class)
+bst_app_class_init (BstAppClass *klass)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (class);
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- bst_app_class = class;
+ bst_app_class = klass;
gobject_class->finalize = bst_app_finalize;
@@ -1258,5 +1258,5 @@ bst_app_class_init (BstAppClass *class)
widget_class->delete_event = bst_app_handle_delete_event;
- class->apps = NULL;
+ klass->apps = NULL;
}
diff --git a/beast-gtk/bstasciipixbuf.c b/beast-gtk/bstasciipixbuf.cc
similarity index 99%
rename from beast-gtk/bstasciipixbuf.c
rename to beast-gtk/bstasciipixbuf.cc
index df6df95..a117e7c 100644
--- a/beast-gtk/bstasciipixbuf.c
+++ b/beast-gtk/bstasciipixbuf.cc
@@ -42,10 +42,9 @@ static void
bst_ascii_pixbuf_child_destroy (guint8 *pixels,
gpointer data)
{
- GdkPixbuf *pixbuf = data;
-
- g_return_if_fail (pixbuf == ascii_pixbuf);
+ GdkPixbuf *pixbuf = (GdkPixbuf*) data;
+ g_return_if_fail (pixbuf == ascii_pixbuf);
g_object_unref (pixbuf);
}
diff --git a/beast-gtk/bstauxdialogs.c b/beast-gtk/bstauxdialogs.cc
similarity index 86%
rename from beast-gtk/bstauxdialogs.c
rename to beast-gtk/bstauxdialogs.cc
index ecea050..e5faf13 100644
--- a/beast-gtk/bstauxdialogs.c
+++ b/beast-gtk/bstauxdialogs.cc
@@ -43,7 +43,7 @@ ensure_list_popups (void)
{
if (!list_popups)
{
- GtkWidget *scwin = g_object_new (GTK_TYPE_SCROLLED_WINDOW,
+ GtkWidget *scwin = (GtkWidget*) g_object_new (GTK_TYPE_SCROLLED_WINDOW,
"hscrollbar_policy", GTK_POLICY_AUTOMATIC,
"vscrollbar_policy", GTK_POLICY_ALWAYS,
"border_width", 0,
@@ -51,7 +51,7 @@ ensure_list_popups (void)
NULL);
GtkListStore *lstore = gtk_list_store_new (1, G_TYPE_STRING);
GtkTreeSelection *tsel;
- GtkTreeView *tview = g_object_new (GTK_TYPE_TREE_VIEW,
+ GtkTreeView *tview = (GtkTreeView*) g_object_new (GTK_TYPE_TREE_VIEW,
"can_focus", TRUE,
"model", lstore,
"parent", scwin,
@@ -69,18 +69,18 @@ ensure_list_popups (void)
"0:H", bc = bst_stock_dbutton (BST_STOCK_CLOSE),
NULL),
NULL);
- GtkWidget *dialog = gxk_dialog_new (NULL, NULL,
- GXK_DIALOG_HIDE_ON_DELETE | GXK_DIALOG_MODAL,
- NULL, content);
+ GtkWidget *dialog = (GtkWidget*) gxk_dialog_new (NULL, NULL,
+ GXK_DIALOG_HIDE_ON_DELETE | GXK_DIALOG_MODAL,
+ NULL, content);
gxk_dialog_set_default (GXK_DIALOG (dialog), bc);
- g_object_set_data (dialog, "tree-view", tview);
+ g_object_set_data ((GObject*) dialog, "tree-view", tview);
g_object_connect (br, "swapped_signal::clicked", tree_view_remove_selection, tview, NULL);
g_object_connect (bc, "swapped_signal::clicked", widget_flag_data_valid, dialog, NULL);
g_object_connect (bc, "swapped_signal_after::clicked", gxk_toplevel_delete, bc, NULL);
tsel = gtk_tree_view_get_selection (tview);
gtk_tree_selection_set_mode (tsel, GTK_SELECTION_BROWSE);
gxk_tree_selection_force_browse (tsel, GTK_TREE_MODEL (lstore));
- gxk_tree_view_add_text_column (tview, 0, "", 0.0, NULL, NULL, NULL, NULL, 0);
+ gxk_tree_view_add_text_column (tview, 0, "", 0.0, NULL, NULL, NULL, NULL, GConnectFlags (0));
list_popups = g_slist_prepend (list_popups, dialog);
}
}
@@ -98,7 +98,7 @@ bst_list_popup_hidden (GtkWidget *dialog,
glong valid = g_object_get_long (dialog, "data-valid");
if (valid && data->handler)
{
- GtkTreeView *tview = g_object_get_data (dialog, "tree-view");
+ GtkTreeView *tview = (GtkTreeView*) g_object_get_data ((GObject*) dialog, "tree-view");
GtkTreeModel *model = gtk_tree_view_get_model (tview);
GtkTreeIter iter;
gchar **strings = g_new0 (gchar*, 1);
@@ -131,10 +131,10 @@ bst_list_popup_new (const gchar *title,
{
GtkWidget *dialog;
ensure_list_popups ();
- dialog = g_slist_pop_head (&list_popups);
+ dialog = (GtkWidget*) g_slist_pop_head (&list_popups);
if (dialog)
{
- GtkTreeView *tview = g_object_get_data (dialog, "tree-view");
+ GtkTreeView *tview = (GtkTreeView*) g_object_get_data ((GObject*) dialog, "tree-view");
GtkTreeModel *model = gtk_tree_view_get_model (tview);
GtkListStore *lstore = GTK_LIST_STORE (model);
CustomPopupData *data = g_new0 (CustomPopupData, 1);
@@ -157,7 +157,7 @@ void
bst_list_popup_add (GtkWidget *dialog,
const gchar *string)
{
- GtkTreeView *tview = g_object_get_data (dialog, "tree-view");
+ GtkTreeView *tview = (GtkTreeView*) g_object_get_data ((GObject*) dialog, "tree-view");
GtkTreeModel *model = gtk_tree_view_get_model (tview);
GtkListStore *lstore = GTK_LIST_STORE (model);
GtkTreeIter iter;
@@ -174,7 +174,7 @@ static void colorsel_enable_activates_default (GtkWidget *widget);
static gboolean
idle_activate_toplevel (gpointer data)
{
- GtkWidget *widget = data;
+ GtkWidget *widget = (GtkWidget*) data;
GDK_THREADS_ENTER ();
gxk_toplevel_activate_default (widget);
g_object_unref (widget);
@@ -231,10 +231,10 @@ ensure_color_popups (void)
"0:H", bc = bst_stock_dbutton (BST_STOCK_CLOSE),
NULL),
NULL);
- GtkWidget *dialog = gxk_dialog_new (NULL, NULL,
- GXK_DIALOG_HIDE_ON_DELETE | GXK_DIALOG_MODAL,
- NULL, content);
- g_object_set_data (dialog, "color-selection", csel);
+ GtkWidget *dialog = (GtkWidget*) gxk_dialog_new (NULL, NULL,
+ GXK_DIALOG_HIDE_ON_DELETE | GXK_DIALOG_MODAL,
+ NULL, content);
+ g_object_set_data ((GObject*) dialog, "color-selection", csel);
colorsel_enable_activates_default (widget);
gtk_widget_show (widget);
gxk_dialog_set_default (GXK_DIALOG (dialog), bc);
@@ -254,7 +254,7 @@ color_popup_hidden (GtkWidget *dialog,
glong valid = g_object_get_long (dialog, "data-valid");
if (valid && data->handler)
{
- GtkColorSelection *csel = g_object_get_data (dialog, "color-selection");
+ GtkColorSelection *csel = (GtkColorSelection*) g_object_get_data ((GObject*) dialog, "color-selection");
GdkColor color;
gtk_color_selection_get_current_color (csel, &color);
((BstColorPopupHandler) data->handler) (dialog, &color, data->data);
@@ -276,10 +276,10 @@ bst_color_popup_new (const gchar *title,
{
GtkWidget *dialog;
ensure_color_popups ();
- dialog = g_slist_pop_head (&color_popups);
+ dialog = (GtkWidget*) g_slist_pop_head (&color_popups);
if (dialog)
{
- GtkColorSelection *csel = g_object_get_data (dialog, "color-selection");
+ GtkColorSelection *csel = (GtkColorSelection*) g_object_get_data ((GObject*) dialog, "color-selection");
CustomPopupData *data = g_new0 (CustomPopupData, 1);
g_object_set_long (dialog, "data-valid", 0);
gtk_color_selection_set_current_color (csel, &color);
@@ -334,7 +334,7 @@ grab_key_event (GtkWidget *window,
break;
case GDK_KEY_PRESS:
grab_key_keyval = gdk_keyval_to_lower (event->key.keyval);
- grab_key_modifier = event->key.state & (GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_MOD1_MASK);
+ grab_key_modifier = GdkModifierType (event->key.state) & (GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_MOD1_MASK);
if (bst_key_combo_valid (grab_key_keyval, grab_key_modifier))
{
grab_key_valid = TRUE;
@@ -358,14 +358,15 @@ bst_key_combo_popup (const gchar *function,
static GtkWidget *label;
if (!key_window)
{
- key_window = g_object_new (GTK_TYPE_WINDOW,
- "type", GTK_WINDOW_POPUP,
- "modal", TRUE,
- "window-position", GTK_WIN_POS_CENTER_ALWAYS,
- "default-width", 320,
- "default-height", 200,
- NULL);
- label = g_object_new (GTK_TYPE_LABEL,
+ key_window = (GtkWidget*) g_object_new (GTK_TYPE_WINDOW,
+ "type", GTK_WINDOW_POPUP,
+ "modal", TRUE,
+ "window-position", GTK_WIN_POS_CENTER_ALWAYS,
+ "default-width", 320,
+ "default-height", 200,
+ NULL);
+ label = (GtkWidget*)
+ g_object_new (GTK_TYPE_LABEL,
"visible", TRUE,
"wrap", TRUE,
"parent",
@@ -407,6 +408,6 @@ bst_key_combo_popup (const gchar *function,
if (keyval)
*keyval = grab_key_valid ? grab_key_keyval : 0;
if (modifier)
- *modifier = grab_key_valid ? grab_key_modifier : 0;
+ *modifier = grab_key_valid ? grab_key_modifier : GdkModifierType (0);
return grab_key_valid;
}
diff --git a/beast-gtk/bstbseutils.c b/beast-gtk/bstbseutils.cc
similarity index 100%
rename from beast-gtk/bstbseutils.c
rename to beast-gtk/bstbseutils.cc
diff --git a/beast-gtk/bstbuseditor.c b/beast-gtk/bstbuseditor.cc
similarity index 94%
rename from beast-gtk/bstbuseditor.c
rename to beast-gtk/bstbuseditor.cc
index 1609d36..f31c605 100644
--- a/beast-gtk/bstbuseditor.c
+++ b/beast-gtk/bstbuseditor.cc
@@ -75,7 +75,7 @@ GtkWidget*
bst_bus_editor_new (SfiProxy bus)
{
g_return_val_if_fail (BSE_IS_BUS (bus), NULL);
- GtkWidget *widget = g_object_new (BST_TYPE_BUS_EDITOR, NULL);
+ GtkWidget *widget = (GtkWidget*) g_object_new (BST_TYPE_BUS_EDITOR, NULL);
BstBusEditor *self = BST_BUS_EDITOR (widget);
bst_bus_editor_set_bus (self, bus);
return widget;
@@ -121,7 +121,7 @@ bus_build_param (BstBusEditor *self,
{
GParamSpec *pspec = bse_proxy_get_pspec (self->item, property);
self->params = sfi_ring_prepend (self->params, bst_param_new_proxy (pspec, self->item));
- GtkWidget *ewidget = gxk_param_create_editor (self->params->data, editor);
+ GtkWidget *ewidget = gxk_param_create_editor ((GxkParam*) self->params->data, editor);
gxk_radget_add (self, area, ewidget);
if (label)
g_object_set (gxk_parent_find_descendant (ewidget, GTK_TYPE_LABEL), "label", label, NULL);
@@ -150,7 +150,7 @@ bst_bus_editor_set_bus (BstBusEditor *self,
"any-signal", bus_editor_release_item, self,
NULL);
while (self->params)
- gxk_param_destroy (sfi_ring_pop_head (&self->params));
+ gxk_param_destroy ((GxkParam*) sfi_ring_pop_head (&self->params));
}
self->item = item;
if (self->item)
@@ -167,7 +167,7 @@ bst_bus_editor_set_bus (BstBusEditor *self,
pspec = bse_proxy_get_pspec (self->item, "right-volume");
GxkParam *rvolume = bst_param_new_proxy (pspec, self->item);
GtkWidget *rspinner = gxk_param_create_editor (rvolume, "spinner");
- BstDBMeter *dbmeter = gxk_radget_find (self, "db-meter");
+ BstDBMeter *dbmeter = (BstDBMeter*) gxk_radget_find (self, "db-meter");
if (dbmeter)
{
GtkRange *range = bst_db_meter_get_scale (dbmeter, 0);
@@ -196,7 +196,7 @@ bst_bus_editor_set_bus (BstBusEditor *self,
bus_build_param (self, "outputs", "outputs-box", NULL, NULL);
/* update params */
for (ring = self->params; ring; ring = sfi_ring_walk (ring, self->params))
- gxk_param_update (ring->data);
+ gxk_param_update ((GxkParam*) ring->data);
/* setup scope */
bse_proxy_connect (self->item,
"signal::probes", bus_probes_notify, self,
@@ -241,10 +241,10 @@ bus_editor_action_check (gpointer data,
}
static void
-bst_bus_editor_class_init (BstBusEditorClass *class)
+bst_bus_editor_class_init (BstBusEditorClass *klass)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (class);
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
gobject_class->finalize = bst_bus_editor_finalize;
object_class->destroy = bst_bus_editor_destroy;
diff --git a/beast-gtk/bstbusmixer.c b/beast-gtk/bstbusmixer.cc
similarity index 96%
rename from beast-gtk/bstbusmixer.c
rename to beast-gtk/bstbusmixer.cc
index db26fa4..7206638 100644
--- a/beast-gtk/bstbusmixer.c
+++ b/beast-gtk/bstbusmixer.cc
@@ -80,8 +80,8 @@ bst_bus_mixer_init (BstBusMixer *self)
{
/* complete GUI */
GxkRadget *radget = gxk_radget_complete (GTK_WIDGET (self), "beast", "bus-mixer", NULL);
- GtkWidget *canvas = gxk_radget_find (radget, "canvas");
- self->hbox = g_object_new (GTK_TYPE_HBOX, "visible", 1, "parent", canvas, "spacing", HSPACING, NULL);
+ GtkWidget *canvas = (GtkWidget*) gxk_radget_find (radget, "canvas");
+ self->hbox = (GtkBox*) g_object_new (GTK_TYPE_HBOX, "visible", 1, "parent", canvas, "spacing", HSPACING, NULL);
g_signal_connect_after (self->hbox, "set-focus-child", G_CALLBACK (gtk_widget_queue_draw), NULL);
g_signal_connect_object (self->hbox, "set-focus-child", G_CALLBACK (gxk_widget_update_actions), self, G_CONNECT_SWAPPED | G_CONNECT_AFTER);
g_signal_connect_after (self->hbox, "expose-event", G_CALLBACK (canvas_box_expose_event), self);
@@ -91,7 +91,7 @@ bst_bus_mixer_init (BstBusMixer *self)
NULL, bus_mixer_action_check, bus_mixer_action_exec);
/* add description */
GxkRadget *bdesc = gxk_radget_create ("beast", "bus-description", NULL);
- bus_mixer_add (self, bdesc);
+ bus_mixer_add (self, (GtkWidget*) bdesc);
}
GtkWidget*
@@ -236,9 +236,9 @@ bus_mixer_action_check (gpointer data,
}
static void
-bst_bus_mixer_class_init (BstBusMixerClass *class)
+bst_bus_mixer_class_init (BstBusMixerClass *klass)
{
- BstItemViewClass *iview_class = BST_ITEM_VIEW_CLASS (class);
+ BstItemViewClass *iview_class = BST_ITEM_VIEW_CLASS (klass);
iview_class->item_type = "BseBus";
iview_class->set_container = bus_mixer_set_container;
diff --git a/beast-gtk/bstbusview.c b/beast-gtk/bstbusview.cc
similarity index 92%
rename from beast-gtk/bstbusview.c
rename to beast-gtk/bstbusview.cc
index c0c1964..fb0c52c 100644
--- a/beast-gtk/bstbusview.c
+++ b/beast-gtk/bstbusview.cc
@@ -40,9 +40,9 @@ static const GxkStockAction bus_view_actions[] = {
G_DEFINE_TYPE (BstBusView, bst_bus_view, BST_TYPE_ITEM_VIEW);
static void
-bst_bus_view_class_init (BstBusViewClass *class)
+bst_bus_view_class_init (BstBusViewClass *klass)
{
- BstItemViewClass *item_view_class = BST_ITEM_VIEW_CLASS (class);
+ BstItemViewClass *item_view_class = BST_ITEM_VIEW_CLASS (klass);
item_view_class->item_type = "BseBus";
}
@@ -54,14 +54,14 @@ bst_bus_view_init (BstBusView *self)
/* complete GUI */
GxkRadget *radget = gxk_radget_complete (GTK_WIDGET (self), "beast", "bus-view", NULL);
/* setup tree view */
- GtkTreeView *tview = gxk_radget_find (radget, "tree-view");
+ GtkTreeView *tview = (GtkTreeView*) gxk_radget_find (radget, "tree-view");
bst_item_view_complete_tree (iview, tview);
/* create tool actions */
gxk_widget_publish_actions (self, "bus-view-actions",
G_N_ELEMENTS (bus_view_actions), bus_view_actions,
NULL, bus_view_action_check, bus_view_action_exec);
/* create property editor */
- bst_item_view_build_param_view (iview, gxk_radget_find (radget, "property-area"));
+ bst_item_view_build_param_view (iview, (GtkContainer*) gxk_radget_find (radget, "property-area"));
}
GtkWidget*
diff --git a/beast-gtk/bstcanvaslink.c b/beast-gtk/bstcanvaslink.cc
similarity index 82%
rename from beast-gtk/bstcanvaslink.c
rename to beast-gtk/bstcanvaslink.cc
index d83ef5b..867836f 100644
--- a/beast-gtk/bstcanvaslink.c
+++ b/beast-gtk/bstcanvaslink.cc
@@ -58,7 +58,7 @@ bst_canvas_link_destroy (GtkObject *object)
GnomeCanvasGroup *group = GNOME_CANVAS_GROUP (object);
while (group->item_list)
- gtk_object_destroy (group->item_list->data);
+ gtk_object_destroy ((GtkObject*) group->item_list->data);
bst_canvas_link_set_ocsource (clink, NULL, 0);
bst_canvas_link_set_icsource (clink, NULL, 0);
@@ -78,7 +78,7 @@ bst_canvas_link_new (GnomeCanvasGroup *group)
NULL);
/* work around stale canvas pointers, see #340437 */
- g_object_set_data_full (item, "bst-workaround-canvas-ref", g_object_ref (item->canvas), g_object_unref);
+ g_object_set_data_full ((GObject*) item, "bst-workaround-canvas-ref", g_object_ref (item->canvas), g_object_unref);
bst_background_handler1_add (bst_canvas_link_build_async, g_object_ref (item), NULL);
return item;
}
@@ -175,16 +175,16 @@ bst_canvas_link_popup_view (BstCanvasLink *clink)
g_return_if_fail (BST_IS_CANVAS_LINK (clink));
if (!clink->link_view)
- clink->link_view = gxk_dialog_new (&clink->link_view,
- GTK_OBJECT (clink),
- 0,
- NULL,
- gtk_widget_new (GTK_TYPE_FRAME,
- "visible", TRUE,
- "border_width", 5,
- "label", _("Module link"),
- "child", gxk_scroll_text_create (GXK_SCROLL_TEXT_WIDGET_LOOK, NULL),
- NULL));
+ clink->link_view = (GtkWidget*) gxk_dialog_new (&clink->link_view,
+ GTK_OBJECT (clink),
+ GxkDialogFlags (0),
+ NULL,
+ gtk_widget_new (GTK_TYPE_FRAME,
+ "visible", TRUE,
+ "border_width", 5,
+ "label", _("Module link"),
+ "child", gxk_scroll_text_create (GXK_SCROLL_TEXT_WIDGET_LOOK, NULL),
+ NULL));
clink_view_update (clink, TRUE);
gxk_widget_showraise (clink->link_view);
}
@@ -286,49 +286,59 @@ bst_canvas_link_build_async (gpointer data)
{
BstCanvasLink *clink = BST_CANVAS_LINK (item);
if (!clink->arrow)
- clink->arrow = g_object_connect (gnome_canvas_item_new (GNOME_CANVAS_GROUP (clink),
- GNOME_TYPE_CANVAS_POLYGON,
- "outline_color_rgba", 0x000000ff,
- "fill_color_rgba", 0xff0000ff,
- NULL),
- "signal::destroy", gtk_widget_destroyed, &clink->arrow,
- "swapped_signal::event", bst_canvas_link_child_event, clink,
- NULL);
+ {
+ clink->arrow = gnome_canvas_item_new (GNOME_CANVAS_GROUP (clink),
+ GNOME_TYPE_CANVAS_POLYGON,
+ "outline_color_rgba", 0x000000ff,
+ "fill_color_rgba", 0xff0000ff,
+ NULL);
+ g_object_connect (clink->arrow,
+ "signal::destroy", gtk_widget_destroyed, &clink->arrow,
+ "swapped_signal::event", bst_canvas_link_child_event, clink,
+ NULL);
+ }
if (!clink->tag_start)
- clink->tag_start = g_object_connect (gnome_canvas_item_new (GNOME_CANVAS_GROUP (clink),
- GNOME_TYPE_CANVAS_ELLIPSE,
- "outline_color_rgba", 0x000000ff, // xffff00ff,
- "fill_color_rgba", 0xffff00ff,
- NULL),
- "signal::destroy", gtk_widget_destroyed, &clink->tag_start,
- "swapped_signal::event", bst_canvas_link_child_event, clink,
- NULL);
+ {
+ clink->tag_start = gnome_canvas_item_new (GNOME_CANVAS_GROUP (clink),
+ GNOME_TYPE_CANVAS_ELLIPSE,
+ "outline_color_rgba", 0x000000ff, // xffff00ff,
+ "fill_color_rgba", 0xffff00ff,
+ NULL);
+ g_object_connect (clink->tag_start,
+ "signal::destroy", gtk_widget_destroyed, &clink->tag_start,
+ "swapped_signal::event", bst_canvas_link_child_event, clink,
+ NULL);
+ }
if (!clink->tag_end)
{
gboolean is_jchannel = FALSE;
if (clink->icsource)
is_jchannel = bst_canvas_source_is_jchannel (clink->icsource, clink->ichannel);
- clink->tag_end = g_object_connect (gnome_canvas_item_new (GNOME_CANVAS_GROUP (clink),
- GNOME_TYPE_CANVAS_ELLIPSE,
- "outline_color_rgba", 0x000000ff, // 0xff0000ff,
- "fill_color_rgba", is_jchannel ? 0x00ff00ff : 0xff0000ff,
- NULL),
- "signal::destroy", gtk_widget_destroyed, &clink->tag_end,
- "swapped_signal::event", bst_canvas_link_child_event, clink,
- NULL);
+ clink->tag_end = gnome_canvas_item_new (GNOME_CANVAS_GROUP (clink),
+ GNOME_TYPE_CANVAS_ELLIPSE,
+ "outline_color_rgba", 0x000000ff, // 0xff0000ff,
+ "fill_color_rgba", is_jchannel ? 0x00ff00ff : 0xff0000ff,
+ NULL);
+ g_object_connect (clink->tag_end,
+ "signal::destroy", gtk_widget_destroyed, &clink->tag_end,
+ "swapped_signal::event", bst_canvas_link_child_event, clink,
+ NULL);
}
if (!clink->line)
- clink->line = g_object_connect (gnome_canvas_item_new (GNOME_CANVAS_GROUP (clink),
- GNOME_TYPE_CANVAS_LINE,
- "fill_color", "black",
- NULL),
- "signal::destroy", gtk_widget_destroyed, &clink->line,
- "swapped_signal::notify", bst_canvas_link_adjust_arrow, clink,
- "swapped_signal::notify", bst_canvas_link_adjust_tags, clink,
- NULL);
+ {
+ clink->line = gnome_canvas_item_new (GNOME_CANVAS_GROUP (clink),
+ GNOME_TYPE_CANVAS_LINE,
+ "fill_color", "black",
+ NULL);
+ g_object_connect (clink->line,
+ "signal::destroy", gtk_widget_destroyed, &clink->line,
+ "swapped_signal::notify", bst_canvas_link_adjust_arrow, clink,
+ "swapped_signal::notify", bst_canvas_link_adjust_tags, clink,
+ NULL);
+ }
bst_canvas_link_update (clink);
}
- GnomeCanvas *canvas = g_object_steal_data (item, "bst-workaround-canvas-ref");
+ GnomeCanvas *canvas = (GnomeCanvas*) g_object_steal_data ((GObject*) item, "bst-workaround-canvas-ref");
g_object_unref (item);
if (canvas)
g_object_unref (canvas); /* canvases don't properly protect their items */
@@ -594,15 +604,15 @@ bst_canvas_link_child_event (GnomeCanvasItem *item,
}
static void
-bst_canvas_link_class_init (BstCanvasLinkClass *class)
+bst_canvas_link_class_init (BstCanvasLinkClass *klass)
{
GtkObjectClass *object_class;
GnomeCanvasItemClass *canvas_item_class;
GnomeCanvasGroupClass *canvas_group_class;
- object_class = GTK_OBJECT_CLASS (class);
- canvas_item_class = GNOME_CANVAS_ITEM_CLASS (class);
- canvas_group_class = GNOME_CANVAS_GROUP_CLASS (class);
+ object_class = GTK_OBJECT_CLASS (klass);
+ canvas_item_class = GNOME_CANVAS_ITEM_CLASS (klass);
+ canvas_group_class = GNOME_CANVAS_GROUP_CLASS (klass);
object_class->destroy = bst_canvas_link_destroy;
canvas_item_class->event = bst_canvas_link_event;
diff --git a/beast-gtk/bstcanvassource.c b/beast-gtk/bstcanvassource.cc
similarity index 90%
rename from beast-gtk/bstcanvassource.c
rename to beast-gtk/bstcanvassource.cc
index 259281d..ac3318d 100644
--- a/beast-gtk/bstcanvassource.c
+++ b/beast-gtk/bstcanvassource.cc
@@ -111,7 +111,7 @@ source_channels_changed (BstCanvasSource *csource)
static gboolean
idle_move_item (gpointer data)
{
- BstCanvasSource *self = data;
+ BstCanvasSource *self = (BstCanvasSource*) data;
GnomeCanvasItem *item = GNOME_CANVAS_ITEM (self);
GDK_THREADS_ENTER ();
@@ -128,8 +128,8 @@ idle_move_item (gpointer data)
g_object_freeze_notify (G_OBJECT (self));
gnome_canvas_item_move (item, x, y);
/* canvas notification bug workaround */
- g_object_notify (self, "x");
- g_object_notify (self, "y");
+ g_object_notify ((GObject*) self, "x");
+ g_object_notify ((GObject*) self, "y");
g_object_thaw_notify (G_OBJECT (self));
}
self->idle_reposition = FALSE;
@@ -206,9 +206,9 @@ bst_canvas_source_destroy (GtkObject *object)
}
while (csource->channel_hints)
- gtk_object_destroy (csource->channel_hints->data);
+ gtk_object_destroy ((GtkObject*) csource->channel_hints->data);
while (group->item_list)
- gtk_object_destroy (group->item_list->data);
+ gtk_object_destroy ((GtkObject*) group->item_list->data);
if (csource->source)
{
@@ -287,11 +287,11 @@ canvas_source_create_params (BstCanvasSource *csource)
GtkWidget *param_view;
param_view = bst_param_view_new (csource->source);
- csource->params_dialog = gxk_dialog_new (&csource->params_dialog,
- GTK_OBJECT (csource),
- GXK_DIALOG_POPUP_POS,
- bse_item_get_name_or_type (csource->source),
- param_view);
+ csource->params_dialog = (GtkWidget*) gxk_dialog_new (&csource->params_dialog,
+ GTK_OBJECT (csource),
+ GXK_DIALOG_POPUP_POS,
+ bse_item_get_name_or_type (csource->source),
+ param_view);
source_name_changed (csource);
}
}
@@ -339,7 +339,7 @@ bst_canvas_source_set_channel_hints (BstCanvasSource *csource,
csource->show_hints = !!on_off;
if (csource->show_hints)
for (slist = csource->channel_hints; slist; slist = slist->next)
- g_object_set (slist->data, "text", g_object_get_data (slist->data, "hint_text"), NULL);
+ g_object_set (slist->data, "text", g_object_get_data ((GObject*) slist->data, "hint_text"), NULL);
else
for (slist = csource->channel_hints; slist; slist = slist->next)
g_object_set (slist->data, "text", "", NULL);
@@ -354,7 +354,6 @@ csource_info_update (BstCanvasSource *csource)
if (text)
{
const gchar *string;
- guint i;
/* construct information */
gxk_scroll_text_clear (text);
@@ -374,7 +373,7 @@ csource_info_update (BstCanvasSource *csource)
gxk_scroll_text_aprintf (text, "\nInput Channels:\n");
gxk_scroll_text_push_indent (text);
}
- for (i = 0; i < bse_source_n_ichannels (csource->source); i++)
+ for (int i = 0; i < bse_source_n_ichannels (csource->source); i++)
{
string = bse_source_ichannel_blurb (csource->source, i);
gxk_scroll_text_aprintf (text, "%s[%s]%s\n",
@@ -397,7 +396,7 @@ csource_info_update (BstCanvasSource *csource)
gxk_scroll_text_aprintf (text, "\nOutput Channels:\n");
gxk_scroll_text_push_indent (text);
}
- for (i = 0; i < bse_source_n_ochannels (csource->source); i++)
+ for (int i = 0; i < bse_source_n_ochannels (csource->source); i++)
{
string = bse_source_ochannel_blurb (csource->source, i);
gxk_scroll_text_aprintf (text, "%s[%s]%s\n",
@@ -454,12 +453,12 @@ bst_canvas_source_popup_info (BstCanvasSource *csource)
"parent", frame,
"border_width", 2,
"child", sctext,
- NULL),
- csource->source_info = gxk_dialog_new (&csource->source_info,
- GTK_OBJECT (csource),
- GXK_DIALOG_POPUP_POS,
- bse_item_get_name_or_type (csource->source),
- sctext);
+ NULL);
+ csource->source_info = (GtkWidget*) gxk_dialog_new (&csource->source_info,
+ GTK_OBJECT (csource),
+ GXK_DIALOG_POPUP_POS,
+ bse_item_get_name_or_type (csource->source),
+ sctext);
}
csource_info_update (csource);
source_name_changed (csource);
@@ -670,7 +669,6 @@ bst_canvas_source_build_channels (BstCanvasSource *csource,
gdouble x1, x2, y1, y2;
gdouble d_y;
gboolean east_channel = CHANNEL_EAST (csource, is_input);
- guint i;
if (is_input)
{
@@ -709,23 +707,24 @@ bst_canvas_source_build_channels (BstCanvasSource *csource,
GnomeCanvasItem *item;
if (build_channel_items)
{
- item = g_object_connect (gnome_canvas_item_new (group,
- GNOME_TYPE_CANVAS_RECT,
- "fill_color_rgba", (0xc3c3c3 << 8) | alpha,
- "outline_color_rgba", RGBA_BLACK,
- "x1", x1,
- "y1", y1,
- "x2", x2,
- "y2", y2,
- NULL),
- "swapped_signal::destroy", channel_item_remove, csource,
- "swapped_signal::event", bst_canvas_source_child_event, csource,
- NULL);
+ item = gnome_canvas_item_new (group,
+ GNOME_TYPE_CANVAS_RECT,
+ "fill_color_rgba", (0xc3c3c3 << 8) | alpha,
+ "outline_color_rgba", RGBA_BLACK,
+ "x1", x1,
+ "y1", y1,
+ "x2", x2,
+ "y2", y2,
+ NULL);
+ g_object_connect (item,
+ "swapped_signal::destroy", channel_item_remove, csource,
+ "swapped_signal::event", bst_canvas_source_child_event, csource,
+ NULL);
csource->channel_items = g_slist_prepend (csource->channel_items, item);
}
}
-
- for (i = 0; i < n_channels; i++)
+
+ for (int i = 0; i < n_channels; i++)
{
GnomeCanvasItem *item;
gboolean is_jchannel = is_input && bse_source_is_joint_ichannel_by_id (csource->source, i);
@@ -813,16 +812,17 @@ bst_canvas_source_build_async (gpointer data)
/* add icon to group */
if (!csource->icon_item)
{
- csource->icon_item = g_object_connect (gnome_canvas_item_new (group,
- GNOME_TYPE_CANVAS_PIXBUF,
- "x", ICON_X (csource),
- "y", ICON_Y (csource),
- "width", ICON_WIDTH (csource),
- "height", ICON_HEIGHT (csource),
- NULL),
- "signal::destroy", gtk_widget_destroyed, &csource->icon_item,
- "swapped_signal::event", bst_canvas_source_child_event, csource,
- NULL);
+ csource->icon_item = gnome_canvas_item_new (group,
+ GNOME_TYPE_CANVAS_PIXBUF,
+ "x", ICON_X (csource),
+ "y", ICON_Y (csource),
+ "width", ICON_WIDTH (csource),
+ "height", ICON_HEIGHT (csource),
+ NULL);
+ g_object_connect (csource->icon_item,
+ "signal::destroy", gtk_widget_destroyed, &csource->icon_item,
+ "swapped_signal::event", bst_canvas_source_child_event, csource,
+ NULL);
source_icon_changed (csource);
return TRUE;
}
@@ -871,7 +871,7 @@ bst_canvas_source_build_async (gpointer data)
return TRUE;
}
}
- GnomeCanvas *canvas = g_object_steal_data (item, "bst-workaround-canvas-ref");
+ GnomeCanvas *canvas = (GnomeCanvas*) g_object_steal_data ((GObject*) item, "bst-workaround-canvas-ref");
g_object_unref (item);
if (canvas)
g_object_unref (canvas); /* canvases don't properly protect their items */
@@ -901,9 +901,9 @@ bst_canvas_source_build (BstCanvasSource *csource)
NULL);
/* make sure no items are left over */
while (csource->channel_items)
- gtk_object_destroy (csource->channel_items->data);
+ gtk_object_destroy ((GtkObject*) csource->channel_items->data);
while (csource->channel_hints)
- gtk_object_destroy (csource->channel_hints->data);
+ gtk_object_destroy ((GtkObject*) csource->channel_hints->data);
csource->built_ichannels = FALSE;
csource->built_ochannels = FALSE;
csource->built_ihints = FALSE;
@@ -911,7 +911,7 @@ bst_canvas_source_build (BstCanvasSource *csource)
/* asynchronously rebuild contents */
GnomeCanvasItem *csource_item = GNOME_CANVAS_ITEM (csource);
/* work around stale canvas pointers, see #340437 */
- g_object_set_data_full (csource_item, "bst-workaround-canvas-ref", g_object_ref (csource_item->canvas), g_object_unref);
+ g_object_set_data_full ((GObject*) csource_item, "bst-workaround-canvas-ref", g_object_ref (csource_item->canvas), g_object_unref);
bst_background_handler2_add (bst_canvas_source_build_async, g_object_ref (csource), NULL);
}
@@ -973,7 +973,7 @@ bst_canvas_source_event (GnomeCanvasItem *item,
/* set i/o channel hints */
channel = bst_canvas_source_ichannel_at (csource, event->motion.x, event->motion.y);
- if (channel != ~0)
+ if (channel != ~uint (0))
{
label = bse_source_ichannel_label (csource->source, channel);
ident = bse_source_ichannel_ident (csource->source, channel);
@@ -982,7 +982,7 @@ bst_canvas_source_event (GnomeCanvasItem *item,
else
{
channel = bst_canvas_source_ochannel_at (csource, event->motion.x, event->motion.y);
- if (channel != ~0)
+ if (channel != ~uint (0))
{
label = bse_source_ochannel_label (csource->source, channel);
ident = bse_source_ochannel_ident (csource->source, channel);
@@ -1062,15 +1062,15 @@ bst_canvas_source_child_event (BstCanvasSource *csource,
}
static void
-bst_canvas_source_class_init (BstCanvasSourceClass *class)
+bst_canvas_source_class_init (BstCanvasSourceClass *klass)
{
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
- GnomeCanvasItemClass *canvas_item_class = GNOME_CANVAS_ITEM_CLASS (class);
- /* GnomeCanvasGroupClass *canvas_group_class = GNOME_CANVAS_GROUP_CLASS (class); */
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
+ GnomeCanvasItemClass *canvas_item_class = GNOME_CANVAS_ITEM_CLASS (klass);
+ /* GnomeCanvasGroupClass *canvas_group_class = GNOME_CANVAS_GROUP_CLASS (klass); */
object_class->destroy = bst_canvas_source_destroy;
canvas_item_class->event = bst_canvas_source_event;
- class->update_links = NULL;
+ klass->update_links = NULL;
csource_signals[SIGNAL_UPDATE_LINKS] =
gtk_signal_new ("update-links",
diff --git a/beast-gtk/bstcluehunter.c b/beast-gtk/bstcluehunter.cc
similarity index 89%
rename from beast-gtk/bstcluehunter.c
rename to beast-gtk/bstcluehunter.cc
index cf9b320..82cb1f8 100644
--- a/beast-gtk/bstcluehunter.c
+++ b/beast-gtk/bstcluehunter.cc
@@ -42,7 +42,7 @@ enum {
/* --- prototypes --- */
-static void bst_clue_hunter_class_init (BstClueHunterClass *class);
+static void bst_clue_hunter_class_init (BstClueHunterClass *klass);
static void bst_clue_hunter_init (BstClueHunter *clue_hunter);
static void bst_clue_hunter_destroy (GtkObject *object);
static void bst_clue_hunter_finalize (GObject *object);
@@ -89,7 +89,7 @@ bst_clue_hunter_get_type (void)
{
GtkTypeInfo clue_hunter_info =
{
- "BstClueHunter",
+ (char*) "BstClueHunter",
sizeof (BstClueHunter),
sizeof (BstClueHunterClass),
(GtkClassInitFunc) bst_clue_hunter_class_init,
@@ -98,22 +98,20 @@ bst_clue_hunter_get_type (void)
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
-
clue_hunter_type = gtk_type_unique (GTK_TYPE_WINDOW, &clue_hunter_info);
}
-
return clue_hunter_type;
}
static void
-bst_clue_hunter_class_init (BstClueHunterClass *class)
+bst_clue_hunter_class_init (BstClueHunterClass *klass)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (class);
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- bst_clue_hunter_class = class;
- parent_class = g_type_class_peek_parent (class);
+ bst_clue_hunter_class = klass;
+ parent_class = (GtkWindowClass*) g_type_class_peek_parent (klass);
gobject_class->set_property = bst_clue_hunter_set_property;
gobject_class->get_property = bst_clue_hunter_get_property;
@@ -123,10 +121,10 @@ bst_clue_hunter_class_init (BstClueHunterClass *class)
widget_class->event = bst_clue_hunter_event;
- class->activate = bst_clue_hunter_do_activate;
- class->popup = bst_clue_hunter_do_popup;
- class->popdown = bst_clue_hunter_do_popdown;
- class->select_on = bst_clue_hunter_do_select_on;
+ klass->activate = bst_clue_hunter_do_activate;
+ klass->popup = bst_clue_hunter_do_popup;
+ klass->popdown = bst_clue_hunter_do_popdown;
+ klass->select_on = bst_clue_hunter_do_select_on;
/* override GtkWindow::type property */
g_object_class_install_property (gobject_class,
@@ -152,32 +150,32 @@ bst_clue_hunter_class_init (BstClueHunterClass *class)
g_param_spec_object ("entry", NULL, NULL,
GTK_TYPE_ENTRY, G_PARAM_READWRITE));
- clue_hunter_signals[SIGNAL_ACTIVATE] = g_signal_new ("activate", G_OBJECT_CLASS_TYPE (class),
+ clue_hunter_signals[SIGNAL_ACTIVATE] = g_signal_new ("activate", G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (BstClueHunterClass, activate),
NULL, NULL,
gtk_signal_default_marshaller,
G_TYPE_NONE, 0);
widget_class->activate_signal = clue_hunter_signals[SIGNAL_ACTIVATE];
- clue_hunter_signals[SIGNAL_POPUP] = g_signal_new ("popup", G_OBJECT_CLASS_TYPE (class),
+ clue_hunter_signals[SIGNAL_POPUP] = g_signal_new ("popup", G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (BstClueHunterClass, popup),
NULL, NULL,
gtk_signal_default_marshaller,
G_TYPE_NONE, 0);
- clue_hunter_signals[SIGNAL_POPDOWN] = g_signal_new ("popdown", G_OBJECT_CLASS_TYPE (class),
+ clue_hunter_signals[SIGNAL_POPDOWN] = g_signal_new ("popdown", G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (BstClueHunterClass, popdown),
NULL, NULL,
gtk_signal_default_marshaller,
G_TYPE_NONE, 0);
- clue_hunter_signals[SIGNAL_SELECT_ON] = g_signal_new ("select-on", G_OBJECT_CLASS_TYPE (class),
+ clue_hunter_signals[SIGNAL_SELECT_ON] = g_signal_new ("select-on", G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (BstClueHunterClass, select_on),
NULL, NULL,
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE, 1, G_TYPE_STRING);
- clue_hunter_signals[SIGNAL_POLL_REFRESH] = g_signal_new ("poll-refresh", G_OBJECT_CLASS_TYPE (class),
+ clue_hunter_signals[SIGNAL_POLL_REFRESH] = g_signal_new ("poll-refresh", G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (BstClueHunterClass, poll_refresh),
NULL, NULL,
@@ -204,24 +202,24 @@ bst_clue_hunter_init (BstClueHunter *self)
"allow_shrink", FALSE,
"allow_grow", FALSE,
NULL);
- parent = g_object_new (GTK_TYPE_FRAME,
- "visible", TRUE,
- "label", NULL,
- "shadow", GTK_SHADOW_OUT,
- "parent", self,
- NULL);
- self->scw = g_object_new (GTK_TYPE_SCROLLED_WINDOW,
- "visible", TRUE,
- "hscrollbar_policy", GTK_POLICY_AUTOMATIC,
- "vscrollbar_policy", GTK_POLICY_AUTOMATIC,
- "parent", parent,
- NULL);
+ parent = (GtkWidget*) g_object_new (GTK_TYPE_FRAME,
+ "visible", TRUE,
+ "label", NULL,
+ "shadow", GTK_SHADOW_OUT,
+ "parent", self,
+ NULL);
+ self->scw = (GtkWidget*) g_object_new (GTK_TYPE_SCROLLED_WINDOW,
+ "visible", TRUE,
+ "hscrollbar_policy", GTK_POLICY_AUTOMATIC,
+ "vscrollbar_policy", GTK_POLICY_AUTOMATIC,
+ "parent", parent,
+ NULL);
self->clist = NULL;
self->entry = NULL;
- clist = g_object_new (GTK_TYPE_CLIST,
- "n_columns", 1,
- "titles_active", FALSE,
- NULL);
+ clist = (GtkCList*) g_object_new (GTK_TYPE_CLIST,
+ "n_columns", 1,
+ "titles_active", FALSE,
+ NULL);
gtk_clist_set_auto_sort (GTK_CLIST (clist), TRUE);
gtk_clist_set_sort_type (GTK_CLIST (clist), GTK_SORT_ASCENDING);
gtk_clist_column_titles_hide (GTK_CLIST (clist));
@@ -244,7 +242,7 @@ bst_clue_hunter_set_property (GObject *object,
case PROP_ALIGN_WIDGET:
if (self->align_widget)
g_object_unref (self->align_widget);
- self->align_widget = g_value_get_object (value);
+ self->align_widget = (GtkWidget*) g_value_get_object (value);
if (self->align_widget)
g_object_ref (self->align_widget);
break;
@@ -252,7 +250,7 @@ bst_clue_hunter_set_property (GObject *object,
self->keep_history = g_value_get_boolean (value);
break;
case PROP_ENTRY:
- bst_clue_hunter_set_entry (self, g_value_get_object (value));
+ bst_clue_hunter_set_entry (self, (GtkEntry*) g_value_get_object (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (self, prop_id, pspec);
@@ -439,16 +437,17 @@ bst_clue_hunter_create_arrow (BstClueHunter *self,
g_return_val_if_fail (BST_IS_CLUE_HUNTER (self), NULL);
- button = g_object_new (GTK_TYPE_BUTTON,
- "visible", TRUE,
- "can_focus", FALSE,
- NULL);
- arrow = g_object_new (GTK_TYPE_ARROW,
- "arrow_type", GTK_ARROW_DOWN,
- "shadow_type", GTK_SHADOW_ETCHED_IN,
- "visible", TRUE,
- "parent", button,
- NULL);
+ button = (GtkWidget*) g_object_new (GTK_TYPE_BUTTON,
+ "visible", TRUE,
+ "can_focus", FALSE,
+ NULL);
+ arrow = (GtkWidget*) g_object_new (GTK_TYPE_ARROW,
+ "arrow_type", GTK_ARROW_DOWN,
+ "shadow_type", GTK_SHADOW_ETCHED_IN,
+ "visible", TRUE,
+ "parent", button,
+ NULL);
+ (void) arrow;
g_object_connect (button,
"swapped_object_signal::clicked", (require_editable ?
bst_clue_hunter_popup_if_editable :
@@ -477,14 +476,11 @@ bst_clue_hunter_entry_key_press (BstClueHunter *self,
!(event->state & (GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_MOD1_MASK)))
{
handled = TRUE;
-
if (event->type == GDK_KEY_PRESS)
{
gchar *cstring;
- gchar *ostring;
-
cstring = bst_clue_hunter_try_complete (self);
- ostring = gtk_entry_get_text (self->entry);
+ const char *ostring = gtk_entry_get_text (self->entry);
if (!ostring)
ostring = "";
if (cstring && strcmp (ostring, cstring))
@@ -588,7 +584,7 @@ bst_clue_hunter_remove_string (BstClueHunter *self,
for (list = self->clist->row_list; list; list = list->next)
{
- GtkCListRow *clist_row = list->data;
+ GtkCListRow *clist_row = (GtkCListRow*) list->data;
gchar *ctext = clist_row->cell[self->clist_column].u.text;
if (ctext && strcmp (string, ctext) == 0)
@@ -618,7 +614,7 @@ bst_clue_hunter_remove_matches (BstClueHunter *self,
list = self->clist->row_list;
while (list)
{
- GtkCListRow *clist_row = list->data;
+ GtkCListRow *clist_row = (GtkCListRow*) list->data;
gchar *ctext = clist_row->cell[self->clist_column].u.text;
list = list->next;
@@ -645,7 +641,7 @@ string_list_intersect (guint max_len,
while (l < max_len)
{
- gchar *s = strings->data;
+ gchar *s = (gchar*) strings->data;
GSList *slist;
s += l;
@@ -653,7 +649,7 @@ string_list_intersect (guint max_len,
for (slist = strings->next; slist; slist = slist->next)
{
- s = slist->data;
+ s = (char*) slist->data;
s += l;
if (completion[l] != *s)
completion[l] = 0;
@@ -679,7 +675,7 @@ bst_clue_hunter_try_complete (BstClueHunter *self)
for (list = self->clist->row_list; list; list = list->next)
{
- GtkCListRow *clist_row = list->data;
+ GtkCListRow *clist_row = (GtkCListRow*) list->data;
if (g_list_find (self->clist->selection, GINT_TO_POINTER (n)))
{
@@ -849,7 +845,7 @@ bst_clue_hunter_add_history (BstClueHunter *self,
for (list = self->clist->row_list; list; list = list->next)
{
- GtkCListRow *clist_row = list->data;
+ GtkCListRow *clist_row = (GtkCListRow*) list->data;
gchar *ctext = clist_row->cell[self->clist_column].u.text;
if (ctext && strcmp (string, ctext) == 0)
@@ -879,7 +875,7 @@ bst_clue_hunter_do_select_on (BstClueHunter *self,
g_free (pattern);
for (list = self->clist->row_list; list; list = list->next)
{
- GtkCListRow *clist_row = list->data;
+ GtkCListRow *clist_row = (GtkCListRow*) list->data;
gchar *ctext = clist_row->cell[self->clist_column].u.text;
if (ctext && g_pattern_match_string (pspec, ctext))
@@ -901,7 +897,7 @@ bst_clue_hunter_do_select_on (BstClueHunter *self,
for (list = self->clist->row_list; list; list = list->next)
{
- GtkCListRow *clist_row = list->data;
+ GtkCListRow *clist_row = (GtkCListRow*) list->data;
gchar *ctext = clist_row->cell[self->clist_column].u.text;
if (ctext && strncmp (cstring, ctext, len) == 0)
{
@@ -936,8 +932,7 @@ bst_clue_hunter_event (GtkWidget *widget,
else if (event->key.keyval == GDK_Return ||
event->key.keyval == GDK_KP_Enter)
{
- gchar *string;
-
+ char *string;
handled = TRUE;
string = bst_clue_hunter_try_complete (self);
if (string)
@@ -948,9 +943,9 @@ bst_clue_hunter_event (GtkWidget *widget,
}
else if (self->keep_history)
{
- string = gtk_entry_get_text (self->entry);
- if (string && string[0])
- bst_clue_hunter_add_history (self, string);
+ const char *cstring = gtk_entry_get_text (self->entry);
+ if (cstring && cstring[0])
+ bst_clue_hunter_add_history (self, cstring);
}
bst_clue_hunter_popdown (self);
/* if (string) */
diff --git a/beast-gtk/bstdbmeter.c b/beast-gtk/bstdbmeter.cc
similarity index 91%
rename from beast-gtk/bstdbmeter.c
rename to beast-gtk/bstdbmeter.cc
index 92febeb..e7e06e2 100644
--- a/beast-gtk/bstdbmeter.c
+++ b/beast-gtk/bstdbmeter.cc
@@ -21,7 +21,7 @@
#define WIDGET(self) (GTK_WIDGET (self))
/* accessors */
-#define STATE(self) (WIDGET (self)->state)
+#define STATE(self) (GtkStateType (WIDGET (self)->state))
#define STYLE(self) (WIDGET (self)->style)
#define XTHICKNESS(self) (STYLE (self)->xthickness)
#define YTHICKNESS(self) (STYLE (self)->ythickness)
@@ -65,8 +65,8 @@ static int
db_color_pixel_cmp (const void *v1,
const void *v2)
{
- const BstDBColor *c1 = v1;
- const BstDBColor *c2 = v2;
+ const BstDBColor *c1 = (const BstDBColor*) v1;
+ const BstDBColor *c2 = (const BstDBColor*) v2;
return c1->pixel < c2->pixel ? -1 : c1->pixel > c2->pixel;
}
@@ -102,7 +102,7 @@ bst_db_setup_new (GxkSpline *db2pixel_spline,
{ -96, 0x00c000 },
};
dbsetup->n_colors = G_N_ELEMENTS (default_colors);
- dbsetup->colors = g_memdup (default_colors, sizeof (dbsetup->colors[0]) * dbsetup->n_colors);
+ dbsetup->colors = (BstDBColor*) g_memdup (default_colors, sizeof (dbsetup->colors[0]) * dbsetup->n_colors);
/* setup zoom and sort colors */
bst_db_setup_relocate (dbsetup, 0, 99, FALSE);
return dbsetup;
@@ -175,9 +175,9 @@ bst_db_setup_copy (BstDBSetup *srcdb)
{
g_return_val_if_fail (srcdb != NULL, NULL);
g_return_val_if_fail (srcdb->ref_count > 0, NULL);
- BstDBSetup *dbsetup = g_memdup (srcdb, sizeof (srcdb[0]));
+ BstDBSetup *dbsetup = (BstDBSetup*) g_memdup (srcdb, sizeof (srcdb[0]));
dbsetup->spline = gxk_spline_copy (srcdb->spline);
- dbsetup->colors = g_memdup (srcdb->colors, sizeof (dbsetup->colors[0]) * dbsetup->n_colors);
+ dbsetup->colors = (BstDBColor*) g_memdup (srcdb->colors, sizeof (dbsetup->colors[0]) * dbsetup->n_colors);
dbsetup->ref_count = 1;
return dbsetup;
}
@@ -299,10 +299,10 @@ bst_db_labeling_size_request (GtkWidget *widget,
* numeric values are to be drawn.
*/
PangoRectangle irect = { 0, }, lrect = { 0 };
- gint i, breadth = 0, length = 0;
+ int breadth = 0, length = 0;
PangoLayout *layout;
-
- for (i = 0; i < self->dbsetup->spline->n_segs; i++)
+
+ for (uint i = 0; i < self->dbsetup->spline->n_segs; i++)
{
double v = self->dbsetup->spline->segs[i].x;
layout = bst_db_labeling_create_layout (self, v);
@@ -492,7 +492,7 @@ bst_db_labeling_draw_value (BstDBLabeling *self,
else if (dtype != DRAW_SKIP)
{
gint cbreadth = vertical ? canvas->width : canvas->height;
- gint clength = vertical ? canvas->height : canvas->width;
+ uint clength = vertical ? canvas->height : canvas->width;
gboolean draw_minors = clength > 8 * dbsetup->spline->n_segs;
gboolean draw_micros = clength > 16 * dbsetup->spline->n_segs;
gboolean draw_subros = clength > 24 * dbsetup->spline->n_segs;
@@ -573,7 +573,6 @@ bst_db_labeling_expose (GtkWidget *widget,
DrawType draw_minor = self->draw_values ? DRAW_SKIP : DRAW_MINOR;
DrawType draw_micro = self->draw_values ? DRAW_SKIP : DRAW_MICRO;
DrawType draw_subro = self->draw_values ? DRAW_SKIP : DRAW_SUBRO;
- gint i;
GdkRectangle zero_consumed = { 0, }, consumed = { 0, }, last_consumed = { 0, };
GdkRectangle canvas = *allocation;
if (vertical)
@@ -596,14 +595,14 @@ bst_db_labeling_expose (GtkWidget *widget,
bst_db_labeling_draw_value (self, &event->area, &canvas, dbsetup->maxdb, &zero_consumed, &zero_consumed, &max_consumed, draw_etched);
consumed = zero_consumed;
/* draw zero..max */
- for (i = dbsetup->zero_index + 1; i < dbsetup->spline->n_segs && dbsetup->spline->segs[i].x < dbsetup->maxdb; i++)
+ for (uint i = dbsetup->zero_index + 1; i < dbsetup->spline->n_segs && dbsetup->spline->segs[i].x < dbsetup->maxdb; i++)
{
if (consumed.width && consumed.height)
last_consumed = consumed;
bst_db_labeling_draw_value (self, &event->area, &canvas, dbsetup->spline->segs[i].x, &max_consumed, &last_consumed, &consumed, draw_major);
}
/* draw minors */
- for (i = dbsetup->zero_index; i < dbsetup->spline->n_segs - 1 && dbsetup->spline->segs[i].x < dbsetup->maxdb; i++)
+ for (uint i = dbsetup->zero_index; i < dbsetup->spline->n_segs - 1 && dbsetup->spline->segs[i].x < dbsetup->maxdb; i++)
{
double db1 = dbsetup->spline->segs[i].x, db2 = dbsetup->spline->segs[i + 1].x;
bst_db_labeling_draw_value (self, &event->area, &canvas, db1 + (db2 - db1) * 0.125,
@@ -632,14 +631,14 @@ bst_db_labeling_expose (GtkWidget *widget,
bst_db_labeling_draw_value (self, &event->area, &canvas, dbsetup->mindb, &zero_consumed, &zero_consumed, &min_consumed, draw_etched);
consumed = zero_consumed;
/* draw min..zero */
- for (i = dbsetup->zero_index - 1; i >= 0 && dbsetup->spline->segs[i].x > dbsetup->mindb; i--)
+ for (uint i = dbsetup->zero_index - 1; i >= 0 && dbsetup->spline->segs[i].x > dbsetup->mindb; i--)
{
if (consumed.width && consumed.height)
last_consumed = consumed;
bst_db_labeling_draw_value (self, &event->area, &canvas, dbsetup->spline->segs[i].x, &min_consumed, &last_consumed, &consumed, draw_major);
}
/* draw minors */
- for (i = 0; i < dbsetup->zero_index; i++)
+ for (uint i = 0; i < uint (dbsetup->zero_index); i++)
{
double db1 = dbsetup->spline->segs[i].x, db2 = dbsetup->spline->segs[i + 1].x;
bst_db_labeling_draw_value (self, &event->area, &canvas, db1 + (db2 - db1) * 0.125,
@@ -705,11 +704,11 @@ bst_db_labeling_set_property (GObject *object,
gtk_widget_queue_resize (widget);
break;
case PROP_ORIENTATION:
- self->orientation = g_value_get_enum (value);
+ self->orientation = (GtkOrientation) g_value_get_enum (value);
gtk_widget_queue_resize (widget);
break;
case PROP_JUSTIFY:
- self->justify = g_value_get_enum (value);
+ self->justify = (GtkJustification) g_value_get_enum (value);
gtk_widget_queue_resize (widget);
break;
default:
@@ -743,11 +742,11 @@ bst_db_labeling_get_property (GObject *object,
}
static void
-bst_db_labeling_class_init (BstDBLabelingClass *class)
+bst_db_labeling_class_init (BstDBLabelingClass *klass)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (class);
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
gobject_class->set_property = bst_db_labeling_set_property;
gobject_class->get_property = bst_db_labeling_get_property;
@@ -1011,7 +1010,7 @@ bst_db_beam_set_property (GObject *object,
switch (prop_id)
{
case PROP_ORIENTATION:
- self->orientation = g_value_get_enum (value);
+ self->orientation = (GtkOrientation) g_value_get_enum (value);
gtk_widget_queue_resize (widget);
break;
default:
@@ -1039,11 +1038,11 @@ bst_db_beam_get_property (GObject *object,
}
static void
-bst_db_beam_class_init (BstDBBeamClass *class)
+bst_db_beam_class_init (BstDBBeamClass *klass)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (class);
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
gobject_class->set_property = bst_db_beam_set_property;
gobject_class->get_property = bst_db_beam_get_property;
@@ -1106,7 +1105,7 @@ bst_db_meter_set_property (GObject *object,
case PROP_ORIENTATION:
if (!GTK_BIN (self)->child)
{
- self->orientation = g_value_get_enum (value);
+ self->orientation = (GtkOrientation) g_value_get_enum (value);
const gboolean vertical = self->orientation == GTK_ORIENTATION_VERTICAL;
g_object_new (vertical ? GTK_TYPE_HBOX : GTK_TYPE_VBOX,
"visible", TRUE,
@@ -1149,7 +1148,7 @@ GtkWidget*
bst_db_meter_new (GtkOrientation orientation,
guint n_channels)
{
- BstDBMeter *self = g_object_new (BST_TYPE_DB_METER, "orientation", orientation, "n-channels", n_channels, NULL);
+ BstDBMeter *self = (BstDBMeter*) g_object_new (BST_TYPE_DB_METER, "orientation", orientation, "n-channels", n_channels, NULL);
return GTK_WIDGET (self);
}
@@ -1173,7 +1172,7 @@ static void
db_meter_setup_recursive (GtkWidget *widget,
gpointer data)
{
- BstDBSetup *dbsetup = data;
+ BstDBSetup *dbsetup = (BstDBSetup*) data;
if (BST_IS_DB_BEAM (widget))
bst_db_beam_setup (BST_DB_BEAM (widget), dbsetup);
else if (BST_IS_DB_LABELING (widget))
@@ -1222,13 +1221,13 @@ BstDBBeam*
bst_db_meter_create_beam (BstDBMeter *self,
guint padding)
{
- GtkBox *box = (void*) GTK_BIN (self)->child;
+ GtkBox *box = (GtkBox*) GTK_BIN (self)->child;
BstDBBeam *aux = NULL;
if (GTK_IS_BOX (box))
{
- aux = g_object_new (BST_TYPE_DB_BEAM,
- "orientation", self->orientation,
- NULL);
+ aux = (BstDBBeam*) g_object_new (BST_TYPE_DB_BEAM,
+ "orientation", self->orientation,
+ NULL);
bst_db_beam_setup (aux, self->dbsetup);
bst_db_beam_set_border (aux, self->border);
gtk_box_pack_start (box, GTK_WIDGET (aux), FALSE, TRUE, padding);
@@ -1240,14 +1239,14 @@ BstDBLabeling*
bst_db_meter_create_numbers (BstDBMeter *self,
guint padding)
{
- GtkBox *box = (void*) GTK_BIN (self)->child;
+ GtkBox *box = (GtkBox*) GTK_BIN (self)->child;
BstDBLabeling *aux = NULL;
if (GTK_IS_BOX (box))
{
- aux = g_object_new (BST_TYPE_DB_LABELING,
- "orientation", self->orientation,
- "draw-values", TRUE,
- NULL);
+ aux = (BstDBLabeling*) g_object_new (BST_TYPE_DB_LABELING,
+ "orientation", self->orientation,
+ "draw-values", TRUE,
+ NULL);
bst_db_labeling_setup (aux, self->dbsetup);
bst_db_labeling_set_border (aux, self->border);
gtk_box_pack_start (box, GTK_WIDGET (aux), FALSE, TRUE, padding);
@@ -1260,15 +1259,15 @@ bst_db_meter_create_dashes (BstDBMeter *self,
GtkJustification justify,
guint padding)
{
- GtkBox *box = (void*) GTK_BIN (self)->child;
+ GtkBox *box = (GtkBox*) GTK_BIN (self)->child;
BstDBLabeling *aux = NULL;
if (GTK_IS_BOX (box))
{
- aux = g_object_new (BST_TYPE_DB_LABELING,
- "orientation", self->orientation,
- "draw-values", FALSE,
- "justify", justify,
- NULL);
+ aux = (BstDBLabeling*) g_object_new (BST_TYPE_DB_LABELING,
+ "orientation", self->orientation,
+ "draw-values", FALSE,
+ "justify", justify,
+ NULL);
bst_db_labeling_setup (aux, self->dbsetup);
bst_db_labeling_set_border (aux, self->border);
gtk_box_pack_start (box, GTK_WIDGET (aux), FALSE, TRUE, padding);
@@ -1282,7 +1281,7 @@ db_scale_pixel_adjustment_value_changed_unconverted (GtkAdjustment *adjustment,
{
if (param->updating)
return;
- BstDBSetup *dbsetup = g_object_get_data (adjustment, "BstDBSetup");
+ BstDBSetup *dbsetup = (BstDBSetup*) g_object_get_data ((GObject*) adjustment, "BstDBSetup");
double value = bst_db_setup_get_dbvalue (dbsetup, adjustment->value);
GValue dvalue = { 0, };
g_value_init (&dvalue, G_TYPE_DOUBLE);
@@ -1296,7 +1295,7 @@ static void
db_scale_pixel_adjustment_update_unconverted (GxkParam *param,
GtkObject *object)
{
- BstDBSetup *dbsetup = g_object_get_data (object, "BstDBSetup");
+ BstDBSetup *dbsetup = (BstDBSetup*) g_object_get_data ((GObject*) object, "BstDBSetup");
GValue dvalue = { 0, };
g_value_init (&dvalue, G_TYPE_DOUBLE);
g_value_transform (¶m->value, &dvalue);
@@ -1310,7 +1309,7 @@ db_scale_pixel_adjustment_value_changed (GtkAdjustment *adjustment,
{
if (param->updating)
return;
- BstDBSetup *dbsetup = g_object_get_data (adjustment, "BstDBSetup");
+ BstDBSetup *dbsetup = (BstDBSetup*) g_object_get_data ((GObject*) adjustment, "BstDBSetup");
double dbvalue = bst_db_setup_get_dbvalue (dbsetup, adjustment->value);
double value = pow (10, dbvalue / 20);
GValue dvalue = { 0, };
@@ -1325,7 +1324,7 @@ static void
db_scale_pixel_adjustment_update (GxkParam *param,
GtkObject *object)
{
- BstDBSetup *dbsetup = g_object_get_data (object, "BstDBSetup");
+ BstDBSetup *dbsetup = (BstDBSetup*) g_object_get_data ((GObject*) object, "BstDBSetup");
GValue dvalue = { 0, };
g_value_init (&dvalue, G_TYPE_DOUBLE);
g_value_transform (¶m->value, &dvalue);
@@ -1360,7 +1359,7 @@ bst_db_scale_hook_up_param (GtkRange *range,
need_conversion ? db_scale_pixel_adjustment_value_changed : db_scale_pixel_adjustment_value_changed_unconverted,
param, NULL);
/* save param for GtkRange */
- g_object_set_data (range, "GxkParam", param);
+ g_object_set_data ((GObject*) range, "GxkParam", param);
}
static void
@@ -1395,14 +1394,14 @@ db_scale_size_allocate (GtkRange *range,
if (range_trough_border && range_trough_border + slider <= tlength / 2)
border += range_trough_border;
/* adjust dbsetup */
- BstDBSetup *dbsetup = g_object_get_data (range, "BstDBSetup");
+ BstDBSetup *dbsetup = (BstDBSetup*) g_object_get_data ((GObject*) range, "BstDBSetup");
if (dbsetup)
{
guint thickness = vertical ? YTHICKNESS (range) : XTHICKNESS (range);
db_setup_size_allocate (dbsetup, thickness, border, vertical ? allocation->height : allocation->width, vertical);
}
/* allow param handling */
- GxkParam *param = g_object_get_data (range, "GxkParam");
+ GxkParam *param = (GxkParam*) g_object_get_data ((GObject*) range, "GxkParam");
/* adapt adjustment to dbsetup */
GtkAdjustment *adjustment = gtk_range_get_adjustment (range);
if (dbsetup && adjustment)
@@ -1440,24 +1439,24 @@ GtkRange*
bst_db_meter_create_scale (BstDBMeter *self,
guint padding)
{
- GtkBox *box = (void*) GTK_BIN (self)->child;
+ GtkBox *box = (GtkBox*) GTK_BIN (self)->child;
GtkRange *range = NULL;
if (GTK_IS_BOX (box))
{
BstDBSetup *dbsetup = bst_db_setup_copy (self->dbsetup);
- GtkAdjustment *adjustment = (void*) gtk_adjustment_new (bst_db_setup_get_pixel (dbsetup, 0),
- bst_db_setup_get_pixel (dbsetup, dbsetup->mindb),
- bst_db_setup_get_pixel (dbsetup, dbsetup->maxdb),
- 0, 0, 0);
- range = g_object_new (self->orientation == GTK_ORIENTATION_VERTICAL ? GTK_TYPE_VSCALE : GTK_TYPE_HSCALE,
- "visible", TRUE,
- "draw_value", FALSE,
- "adjustment", adjustment,
- "can-focus", FALSE,
+ GtkAdjustment *adjustment = (GtkAdjustment*) gtk_adjustment_new (bst_db_setup_get_pixel (dbsetup, 0),
+ bst_db_setup_get_pixel (dbsetup, dbsetup->mindb),
+ bst_db_setup_get_pixel (dbsetup, dbsetup->maxdb),
+ 0, 0, 0);
+ range = (GtkRange*) g_object_new (self->orientation == GTK_ORIENTATION_VERTICAL ? GTK_TYPE_VSCALE : GTK_TYPE_HSCALE,
+ "visible", TRUE,
+ "draw_value", FALSE,
+ "adjustment", adjustment,
+ "can-focus", FALSE,
NULL);
gtk_box_pack_start (box, GTK_WIDGET (range), FALSE, TRUE, padding);
- g_object_set_data_full (range, "BstDBSetup", dbsetup, bst_db_setup_unref);
- g_object_set_data_full (adjustment, "BstDBSetup", bst_db_setup_ref (dbsetup), bst_db_setup_unref);
+ g_object_set_data_full ((GObject*) range, "BstDBSetup", dbsetup, (GDestroyNotify) bst_db_setup_unref);
+ g_object_set_data_full ((GObject*) adjustment, "BstDBSetup", bst_db_setup_ref (dbsetup), (GDestroyNotify) bst_db_setup_unref);
if (!gxk_signal_handler_exists (range, "size-allocate", G_CALLBACK (db_scale_size_allocate), self))
g_signal_connect_object (range, "size-allocate", G_CALLBACK (db_scale_size_allocate), self, G_CONNECT_AFTER);
}
@@ -1469,7 +1468,7 @@ db_meter_get_child (BstDBMeter *self,
guint nth,
GType ctype)
{
- GtkBox *box = (void*) GTK_BIN (self)->child;
+ GtkBox *box = (GtkBox*) GTK_BIN (self)->child;
GtkWidget *child = NULL;
if (GTK_IS_BOX (box))
{
@@ -1481,7 +1480,7 @@ db_meter_get_child (BstDBMeter *self,
nth--;
else
{
- child = node->data;
+ child = (GtkWidget*) node->data;
break;
}
}
@@ -1494,21 +1493,21 @@ GtkRange*
bst_db_meter_get_scale (BstDBMeter *self,
guint nth)
{
- return db_meter_get_child (self, nth, GTK_TYPE_RANGE);
+ return (GtkRange*) db_meter_get_child (self, nth, GTK_TYPE_RANGE);
}
BstDBBeam*
bst_db_meter_get_beam (BstDBMeter *self,
guint nth)
{
- return db_meter_get_child (self, nth, BST_TYPE_DB_BEAM);
+ return (BstDBBeam*) db_meter_get_child (self, nth, BST_TYPE_DB_BEAM);
}
BstDBLabeling*
bst_db_meter_get_labeling (BstDBMeter *self,
guint nth)
{
- return db_meter_get_child (self, nth, BST_TYPE_DB_LABELING);
+ return (BstDBLabeling*) db_meter_get_child (self, nth, BST_TYPE_DB_LABELING);
}
static void
@@ -1543,11 +1542,11 @@ db_meter_build_channels (BstDBMeter *self,
}
static void
-bst_db_meter_class_init (BstDBMeterClass *class)
+bst_db_meter_class_init (BstDBMeterClass *klass)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (class);
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
gobject_class->set_property = bst_db_meter_set_property;
gobject_class->get_property = bst_db_meter_get_property;
diff --git a/beast-gtk/bstdial.c b/beast-gtk/bstdial.cc
similarity index 98%
rename from beast-gtk/bstdial.c
rename to beast-gtk/bstdial.cc
index 2a53982..0bdd23f 100644
--- a/beast-gtk/bstdial.c
+++ b/beast-gtk/bstdial.cc
@@ -26,7 +26,7 @@
#define RATIO 0.75752
#define HCENTER (1.0 / (2 * RATIO))
-static void bst_dial_class_init (BstDialClass *class);
+static void bst_dial_class_init (BstDialClass *klass);
static void bst_dial_init (BstDial *dial);
static void bst_dial_destroy (GtkObject *object);
static void bst_dial_realize (GtkWidget *widget);
@@ -64,7 +64,7 @@ bst_dial_get_type (void)
{
GtkTypeInfo dial_info =
{
- "BstDial",
+ (char*) "BstDial",
sizeof (BstDial),
sizeof (BstDialClass),
(GtkClassInitFunc) bst_dial_class_init,
@@ -81,12 +81,12 @@ bst_dial_get_type (void)
}
static void
-bst_dial_class_init (BstDialClass *class)
+bst_dial_class_init (BstDialClass *klass)
{
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- parent_class = g_type_class_peek_parent (class);
+ parent_class = (GtkWidgetClass*) g_type_class_peek_parent (klass);
object_class->destroy = bst_dial_destroy;
@@ -320,7 +320,7 @@ bst_dial_paint (BstDial *dial)
if (widget->allocation.width >= DIAL_DEFAULT_SIZE)
gtk_draw_polygon (widget->style,
widget->window,
- widget->state,
+ GtkStateType (widget->state),
GTK_SHADOW_ETCHED_IN,
points, 2,
FALSE);
@@ -345,7 +345,7 @@ bst_dial_paint (BstDial *dial)
if (widget->allocation.width >= DIAL_DEFAULT_SIZE)
gtk_draw_polygon (widget->style,
widget->window,
- widget->state,
+ GtkStateType (widget->state),
GTK_SHADOW_OUT,
points, 4,
TRUE);
diff --git a/beast-gtk/bsteffectview.c b/beast-gtk/bsteffectview.cc
similarity index 98%
rename from beast-gtk/bsteffectview.c
rename to beast-gtk/bsteffectview.cc
index e2917e0..243fa15 100644
--- a/beast-gtk/bsteffectview.c
+++ b/beast-gtk/bsteffectview.cc
@@ -68,18 +68,18 @@ bst_effect_view_get_type (void)
}
static void
-bst_effect_view_class_init (BstEffectViewClass *class)
+bst_effect_view_class_init (BstEffectViewClass *klass)
{
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
- bst_effect_view_class = class;
+ bst_effect_view_class = klass;
parent_class = gtk_type_class (GTK_TYPE_ALIGNMENT);
- G_OBJECT_CLASS (class)->finalize = bst_effect_view_finalize;
+ G_OBJECT_CLASS (klass)->finalize = bst_effect_view_finalize;
object_class->destroy = bst_effect_view_destroy;
- class->default_param_view_height = 60;
+ klass->default_param_view_height = 60;
}
static void
diff --git a/beast-gtk/bsteventroll.c b/beast-gtk/bsteventroll.cc
similarity index 96%
rename from beast-gtk/bsteventroll.c
rename to beast-gtk/bsteventroll.cc
index fd09ef6..1cad8f6 100644
--- a/beast-gtk/bsteventroll.c
+++ b/beast-gtk/bsteventroll.cc
@@ -23,7 +23,7 @@
/* --- defines --- */
/* accessors */
#define STYLE(self) (GTK_WIDGET (self)->style)
-#define STATE(self) (GTK_WIDGET (self)->state)
+#define STATE(self) (GtkStateType (GTK_WIDGET (self)->state))
#define XTHICKNESS(self) (STYLE (self)->xthickness)
#define YTHICKNESS(self) (STYLE (self)->ythickness)
#define ALLOCATION(self) (>K_WIDGET (self)->allocation)
@@ -71,10 +71,10 @@ enum {
};
static void
-event_roll_class_setup_skin (BstEventRollClass *class)
+event_roll_class_setup_skin (BstEventRollClass *klass)
{
static GdkColor colors[INDEX_LAST];
- GxkScrollCanvasClass *scroll_canvas_class = GXK_SCROLL_CANVAS_CLASS (class);
+ GxkScrollCanvasClass *scroll_canvas_class = GXK_SCROLL_CANVAS_CLASS (klass);
scroll_canvas_class->n_colors = G_N_ELEMENTS (colors);
scroll_canvas_class->colors = colors;
colors[INDEX_HBAR] = gdk_color_from_rgb (BST_SKIN_CONFIG (controls_hbar));
@@ -302,7 +302,7 @@ event_roll_draw_vpanel (GxkScrollCanvas *scc,
BstEventRoll *self = BST_EVENT_ROLL (scc);
gint width, height;
gdk_window_get_size (drawable, &width, &height);
-
+
if (0)
{
/* outer vpanel shadow */
@@ -351,8 +351,8 @@ event_roll_draw_canvas (GxkScrollCanvas *scc,
{
BstEventRoll *self = BST_EVENT_ROLL (scc);
guint8 *dash, dashes[3] = { 1, 1, 0 }; // long: { 2, 2, 0 };
- GdkGC *draw_gc, *light_gc, *dark_gc;
- gint i, dlen, line_width = 0; /* line widths != 0 interfere with dash-settings on some X servers */
+ GdkGC *draw_gc, *dark_gc;
+ int dlen, line_width = 0; /* line widths != 0 interfere with dash-settings on some X servers */
BsePartControlSeq *cseq;
gint range, mid = event_roll_scale_range (self, &range);
gint x, xbound, width, height;
@@ -381,7 +381,7 @@ event_roll_draw_canvas (GxkScrollCanvas *scc,
gdk_gc_set_line_attributes (draw_gc, line_width, GDK_LINE_ON_OFF_DASH, GDK_CAP_BUTT, GDK_JOIN_MITER);
dash = dashes;
dlen = dash[0] + dash[1];
- gdk_gc_set_dashes (draw_gc, (X_OFFSET (self) + x + 1) % dlen, dash, 2);
+ gdk_gc_set_dashes (draw_gc, (X_OFFSET (self) + x + 1) % dlen, (gint8*) dash, 2);
gdk_draw_line (drawable, draw_gc, x, mid + range / 2, xbound - 1, mid + range / 2);
gdk_draw_line (drawable, draw_gc, x, mid - range / 2, xbound - 1, mid - range / 2);
gdk_gc_set_line_attributes (draw_gc, line_width, GDK_LINE_SOLID, GDK_CAP_BUTT, GDK_JOIN_MITER);
@@ -389,13 +389,12 @@ event_roll_draw_canvas (GxkScrollCanvas *scc,
gdk_draw_line (drawable, draw_gc, x, mid, xbound - 1, mid);
/* draw controls */
- light_gc = STYLE (self)->light_gc[GTK_STATE_NORMAL];
dark_gc = STYLE (self)->dark_gc[GTK_STATE_NORMAL];
cseq = self->proxy ? bse_part_list_controls (self->proxy,
coord_to_tick (self, x, FALSE),
coord_to_tick (self, xbound, FALSE),
self->control_type) : NULL;
- for (i = 0; cseq && i < cseq->n_pcontrols; i++)
+ for (uint i = 0; cseq && i < cseq->n_pcontrols; i++)
{
BsePartControl *pctrl = cseq->pcontrols[i];
guint tick = pctrl->tick;
@@ -403,8 +402,8 @@ event_roll_draw_canvas (GxkScrollCanvas *scc,
gint x1, x2, y1, y2;
gboolean selected = pctrl->selected;
- selected |= (pctrl->tick >= self->selection_tick &&
- pctrl->tick < self->selection_tick + self->selection_duration);
+ selected |= (uint (pctrl->tick) >= self->selection_tick &&
+ uint (pctrl->tick) < self->selection_tick + self->selection_duration);
if (selected)
{
xdark_gc = STYLE (self)->bg_gc[GTK_STATE_SELECTED];
@@ -722,8 +721,7 @@ bst_event_roll_set_view_selection (BstEventRoll *self,
}
void
-bst_event_roll_set_control_type (BstEventRoll *self,
- guint control_type)
+bst_event_roll_set_control_type (BstEventRoll *self, BseMidiSignalType control_type)
{
g_return_if_fail (BST_IS_EVENT_ROLL (self));
@@ -804,13 +802,13 @@ bst_event_roll_clear_segment (BstEventRoll *self)
}
static void
-bst_event_roll_class_init (BstEventRollClass *class)
+bst_event_roll_class_init (BstEventRollClass *klass)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (class);
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
- GtkContainerClass *container_class = GTK_CONTAINER_CLASS (class);
- GxkScrollCanvasClass *scroll_canvas_class = GXK_SCROLL_CANVAS_CLASS (class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+ GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
+ GxkScrollCanvasClass *scroll_canvas_class = GXK_SCROLL_CANVAS_CLASS (klass);
gobject_class->dispose = bst_event_roll_dispose;
gobject_class->finalize = bst_event_roll_finalize;
@@ -831,28 +829,28 @@ bst_event_roll_class_init (BstEventRollClass *class)
scroll_canvas_class->draw_canvas = event_roll_draw_canvas;
scroll_canvas_class->handle_drag = event_roll_handle_drag;
- bst_skin_config_add_notify ((BstSkinConfigNotify) event_roll_class_setup_skin, class);
- event_roll_class_setup_skin (class);
+ bst_skin_config_add_notify ((BstSkinConfigNotify) event_roll_class_setup_skin, klass);
+ event_roll_class_setup_skin (klass);
- class->canvas_clicked = NULL;
+ klass->canvas_clicked = NULL;
- signal_canvas_drag = g_signal_new ("canvas-drag", G_OBJECT_CLASS_TYPE (class),
+ signal_canvas_drag = g_signal_new ("canvas-drag", G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (BstEventRollClass, canvas_drag),
NULL, NULL,
bst_marshal_NONE__POINTER,
G_TYPE_NONE, 1, G_TYPE_POINTER);
- signal_canvas_clicked = g_signal_new ("canvas-clicked", G_OBJECT_CLASS_TYPE (class),
+ signal_canvas_clicked = g_signal_new ("canvas-clicked", G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (BstEventRollClass, canvas_clicked),
NULL, NULL,
bst_marshal_NONE__UINT_UINT_FLOAT_BOXED,
G_TYPE_NONE, 4, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_FLOAT,
GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
- signal_vpanel_drag = g_signal_new ("vpanel-drag", G_OBJECT_CLASS_TYPE (class),
+ signal_vpanel_drag = g_signal_new ("vpanel-drag", G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (BstEventRollClass, vpanel_drag),
NULL, NULL,
bst_marshal_NONE__POINTER,
G_TYPE_NONE, 1, G_TYPE_POINTER);
- signal_vpanel_clicked = g_signal_new ("vpanel-clicked", G_OBJECT_CLASS_TYPE (class),
+ signal_vpanel_clicked = g_signal_new ("vpanel-clicked", G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (BstEventRollClass, vpanel_clicked),
NULL, NULL,
bst_marshal_NONE__UINT_INT_BOXED,
diff --git a/beast-gtk/bsteventroll.h b/beast-gtk/bsteventroll.h
index de14bb2..712baa9 100644
--- a/beast-gtk/bsteventroll.h
+++ b/beast-gtk/bsteventroll.h
@@ -54,7 +54,7 @@ struct _BstEventRoll
GxkScrollCanvas parent_instance;
SfiProxy proxy;
- guint control_type;
+ BseMidiSignalType control_type;
GtkWidget *child;
/* horizontal layout */
@@ -115,8 +115,7 @@ void bst_event_roll_set_view_selection (BstEventRoll *self,
void bst_event_roll_set_vpanel_width_hook (BstEventRoll *self,
gint (*fetch_vpanel_width) (gpointer data),
gpointer data);
-void bst_event_roll_set_control_type (BstEventRoll *self,
- guint control_type);
+void bst_event_roll_set_control_type (BstEventRoll *self, BseMidiSignalType control_type);
void bst_event_roll_init_segment (BstEventRoll *self,
BstSegmentType type);
void bst_event_roll_segment_start (BstEventRoll *self,
diff --git a/beast-gtk/bsteventrollctrl.c b/beast-gtk/bsteventrollctrl.cc
similarity index 99%
rename from beast-gtk/bsteventrollctrl.c
rename to beast-gtk/bsteventrollctrl.cc
index 2e2b8d3..8be0db7 100644
--- a/beast-gtk/bsteventrollctrl.c
+++ b/beast-gtk/bsteventrollctrl.cc
@@ -88,7 +88,7 @@ bst_event_roll_controller_get_clipboard (void)
static void
controller_reset_canvas_cursor (BstEventRollController *self)
{
- controller_update_canvas_cursor (self, self->canvas_rtools->action_id);
+ controller_update_canvas_cursor (self, BstCommonRollTool (self->canvas_rtools->action_id));
}
BstEventRollController*
@@ -114,8 +114,8 @@ bst_event_roll_controller_new (BstEventRoll *eroll,
G_CALLBACK (controller_vpanel_drag),
self, NULL,
G_CONNECT_SWAPPED);
- self->quant_rtools = g_object_ref (quant_rtools);
- self->canvas_rtools = g_object_ref (canvas_rtools);
+ self->quant_rtools = (GxkActionGroup*) g_object_ref (quant_rtools);
+ self->canvas_rtools = (GxkActionGroup*) g_object_ref (canvas_rtools);
/* update from atools */
g_object_connect (self->canvas_rtools,
"swapped_signal::changed", controller_reset_canvas_cursor, self,
diff --git a/beast-gtk/bstfiledialog.c b/beast-gtk/bstfiledialog.cc
similarity index 86%
rename from beast-gtk/bstfiledialog.c
rename to beast-gtk/bstfiledialog.cc
index e4e7062..783d8e9 100644
--- a/beast-gtk/bstfiledialog.c
+++ b/beast-gtk/bstfiledialog.cc
@@ -32,9 +32,9 @@ static void bst_file_dialog_activate (BstFileDialog *self);
G_DEFINE_TYPE (BstFileDialog, bst_file_dialog, GXK_TYPE_DIALOG);
static void
-bst_file_dialog_class_init (BstFileDialogClass *class)
+bst_file_dialog_class_init (BstFileDialogClass *klass)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = bst_file_dialog_finalize;
}
@@ -80,22 +80,21 @@ bst_file_dialog_init (BstFileDialog *self)
"spacing", 0,
"border_width", 0,
NULL);
-
+
/* notebook */
- self->notebook = g_object_new (GXK_TYPE_NOTEBOOK,
- "visible", TRUE,
- "show_border", TRUE,
- "show_tabs", TRUE,
- "scrollable", FALSE,
- "tab_border", 0,
- "enable_popup", TRUE,
- "tab_pos", GTK_POS_TOP,
- "border_width", 5,
- "parent", main_box,
- "enable_popup", FALSE,
- NULL);
-
-
+ self->notebook = (GtkWidget*) g_object_new (GXK_TYPE_NOTEBOOK,
+ "visible", TRUE,
+ "show_border", TRUE,
+ "show_tabs", TRUE,
+ "scrollable", FALSE,
+ "tab_border", 0,
+ "enable_popup", TRUE,
+ "tab_pos", GTK_POS_TOP,
+ "border_width", 5,
+ "parent", main_box,
+ "enable_popup", FALSE,
+ NULL);
+
/* setup file selection widgets and add to notebook */
self->fs = (GtkFileSelection*) gtk_file_selection_new ("");
self->fpage = gxk_file_selection_split (self->fs, &bbox);
@@ -103,26 +102,26 @@ bst_file_dialog_init (BstFileDialog *self)
gtk_container_remove (GTK_CONTAINER (self->fpage->parent), self->fpage);
gxk_notebook_append (GTK_NOTEBOOK (self->notebook), self->fpage, "File Selection", TRUE);
g_object_unref (self->fpage);
-
+
/* sample selection tree */
- self->spage = g_object_new (GTK_TYPE_SCROLLED_WINDOW,
- "visible", TRUE,
- "hscrollbar_policy", GTK_POLICY_AUTOMATIC,
- "vscrollbar_policy", GTK_POLICY_ALWAYS,
- "border_width", 5,
- "shadow_type", GTK_SHADOW_IN,
- NULL);
+ self->spage = (GtkWidget*) g_object_new (GTK_TYPE_SCROLLED_WINDOW,
+ "visible", TRUE,
+ "hscrollbar_policy", GTK_POLICY_AUTOMATIC,
+ "vscrollbar_policy", GTK_POLICY_ALWAYS,
+ "border_width", 5,
+ "shadow_type", GTK_SHADOW_IN,
+ NULL);
gxk_notebook_append (GTK_NOTEBOOK (self->notebook), self->spage, "Sample Selection", TRUE);
self->file_store = bst_file_store_create ();
smodel = gtk_tree_model_sort_new_with_model (self->file_store);
- self->tview = g_object_new (GTK_TYPE_TREE_VIEW,
- "visible", TRUE,
- "can_focus", TRUE,
- "model", smodel,
- "rules_hint", TRUE,
- "parent", self->spage,
- "search_column", BST_FILE_STORE_COL_BASE_NAME,
- NULL);
+ self->tview = (GtkTreeView*) g_object_new (GTK_TYPE_TREE_VIEW,
+ "visible", TRUE,
+ "can_focus", TRUE,
+ "model", smodel,
+ "rules_hint", TRUE,
+ "parent", self->spage,
+ "search_column", BST_FILE_STORE_COL_BASE_NAME,
+ NULL);
g_object_unref (smodel);
g_object_connect (self->tview,
"swapped_signal::viewable-changed", tree_viewable_changed, self,
@@ -164,50 +163,50 @@ bst_file_dialog_init (BstFileDialog *self)
gxk_tree_view_add_text_column (self->tview, BST_FILE_STORE_COL_FILE, "S",
0.0, _("Filename"), NULL,
NULL, self, G_CONNECT_SWAPPED);
-
+
/* pack separator and buttons */
gtk_box_pack_end (GTK_BOX (main_box), bbox, FALSE, TRUE, 0);
gtk_box_pack_end (GTK_BOX (main_box),
- g_object_new (GTK_TYPE_HSEPARATOR,
- "visible", TRUE,
- NULL),
+ (GtkWidget*) g_object_new (GTK_TYPE_HSEPARATOR,
+ "visible", TRUE,
+ NULL),
FALSE, TRUE, 0);
-
+
/* setup save options */
- self->osave = g_object_new (GTK_TYPE_FRAME,
- "label", _("Contents"),
- "parent", self->fs->action_area,
- NULL);
- vbox = g_object_new (GTK_TYPE_VBOX,
+ self->osave = (GtkWidget*) g_object_new (GTK_TYPE_FRAME,
+ "label", _("Contents"),
+ "parent", self->fs->action_area,
+ NULL);
+ vbox = (GtkWidget*) g_object_new (GTK_TYPE_VBOX,
"visible", TRUE,
"parent", self->osave,
NULL);
- self->radio1 = g_object_new (GTK_TYPE_RADIO_BUTTON,
- "label", "radio-1",
- "visible", TRUE,
- "parent", vbox,
- "can_focus", FALSE,
- NULL);
+ self->radio1 = (GtkWidget*) g_object_new (GTK_TYPE_RADIO_BUTTON,
+ "label", "radio-1",
+ "visible", TRUE,
+ "parent", vbox,
+ "can_focus", FALSE,
+ NULL);
gtk_misc_set_alignment (GTK_MISC (GTK_BIN (self->radio1)->child), 0, .5);
- self->radio2 = g_object_new (GTK_TYPE_RADIO_BUTTON,
- "label", "radio-2",
- "visible", TRUE,
- "parent", vbox,
- "group", self->radio1,
- "can_focus", FALSE,
- NULL);
+ self->radio2 = (GtkWidget*) g_object_new (GTK_TYPE_RADIO_BUTTON,
+ "label", "radio-2",
+ "visible", TRUE,
+ "parent", vbox,
+ "group", self->radio1,
+ "can_focus", FALSE,
+ NULL);
gtk_misc_set_alignment (GTK_MISC (GTK_BIN (self->radio2)->child), 0, .5);
-
+
/* setup actions */
g_object_connect (self->fs->ok_button, "swapped_signal::clicked", bst_file_dialog_activate, self, NULL);
g_object_connect (self->fs->cancel_button, "swapped_signal::clicked", gxk_toplevel_delete, self, NULL);
-
+
/* fixup focus and default widgets */
gxk_dialog_set_default (GXK_DIALOG (self), self->fs->ok_button);
gxk_dialog_set_focus (GXK_DIALOG (self), self->fs->selection_entry);
-
+
/* setup remaining bits */
- bst_file_dialog_set_mode (self, NULL, 0, _("File Selection"), 0);
+ bst_file_dialog_set_mode (self, NULL, BstFileDialogMode (0), _("File Selection"), 0);
gtk_window_set_type_hint (GTK_WINDOW (self), GDK_WINDOW_TYPE_HINT_DIALOG);
}
@@ -215,12 +214,12 @@ static void
bst_file_dialog_finalize (GObject *object)
{
BstFileDialog *self = BST_FILE_DIALOG (object);
-
- bst_file_dialog_set_mode (self, NULL, 0, NULL, 0);
+
+ bst_file_dialog_set_mode (self, NULL, BstFileDialogMode (0), NULL, 0);
g_free (self->search_path);
self->search_filter = NULL;
bst_file_store_destroy (self->file_store);
-
+
/* chain parent class' handler */
G_OBJECT_CLASS (bst_file_dialog_parent_class)->finalize (object);
}
@@ -230,7 +229,7 @@ bst_file_dialog_global_project (void)
{
static BstFileDialog *singleton = NULL;
if (!singleton)
- singleton = g_object_new (BST_TYPE_FILE_DIALOG, NULL);
+ singleton = (BstFileDialog*) g_object_new (BST_TYPE_FILE_DIALOG, NULL);
return singleton;
}
@@ -239,7 +238,7 @@ bst_file_dialog_global_wave (void)
{
static BstFileDialog *singleton = NULL;
if (!singleton)
- singleton = g_object_new (BST_TYPE_FILE_DIALOG, NULL);
+ singleton = (BstFileDialog*) g_object_new (BST_TYPE_FILE_DIALOG, NULL);
return singleton;
}
@@ -250,7 +249,7 @@ bst_file_dialog_global_effect (void)
if (!singleton)
{
const gchar *dir = bse_server_get_custom_effect_dir (BSE_SERVER);
- singleton = g_object_new (BST_TYPE_FILE_DIALOG, NULL);
+ singleton = (BstFileDialog*) g_object_new (BST_TYPE_FILE_DIALOG, NULL);
if (dir)
{
sfi_make_dirpath (dir);
@@ -267,7 +266,7 @@ bst_file_dialog_global_instrument (void)
if (!singleton)
{
const gchar *dir = bse_server_get_custom_instrument_dir (BSE_SERVER);
- singleton = g_object_new (BST_TYPE_FILE_DIALOG, NULL);
+ singleton = (BstFileDialog*) g_object_new (BST_TYPE_FILE_DIALOG, NULL);
if (dir)
{
sfi_make_dirpath (dir);
@@ -281,7 +280,7 @@ static void
parent_window_destroyed (BstFileDialog *self)
{
gtk_widget_hide (GTK_WIDGET (self));
- bst_file_dialog_set_mode (self, NULL, 0, NULL, 0);
+ bst_file_dialog_set_mode (self, NULL, BstFileDialogMode (0), NULL, 0);
gxk_toplevel_delete (GTK_WIDGET (self));
}
@@ -306,15 +305,15 @@ bst_file_dialog_set_mode (BstFileDialog *self,
bst_window_sync_title_to_proxy (self, proxy, fs_title);
self->proxy = proxy;
self->super = 0;
-
+
/* cleanup connections to old parent_window */
if (self->parent_window)
- g_signal_handlers_disconnect_by_func (self->parent_window, parent_window_destroyed, self);
+ g_signal_handlers_disconnect_by_func (self->parent_window, (void*) parent_window_destroyed, self);
if (window->group)
gtk_window_group_remove_window (window->group, window);
gtk_window_set_transient_for (window, NULL);
-
- self->parent_window = parent_widget ? (GtkWindow*) gtk_widget_get_ancestor (parent_widget, GTK_TYPE_WINDOW) : NULL;
+
+ self->parent_window = parent_widget ? (GtkWindow*) gtk_widget_get_ancestor ((GtkWidget*) parent_widget, GTK_TYPE_WINDOW) : NULL;
/* setup connections to new parent_window */
if (self->parent_window)
@@ -533,7 +532,8 @@ store_bse_file (SfiProxy project,
{
g_free (temp_file);
temp_file = g_strdup_printf ("%s.tmp%06xyXXXXXX", file_name, rand() & 0xfffffd);
- mktemp (temp_file); /* this is save, due to use of: O_CREAT | O_EXCL */
+ char *result = mktemp (temp_file); /* this is save, due to use of: O_CREAT | O_EXCL */
+ (void) result;
error = bse_project_store_bse (project, super, temp_file, self_contained);
}
/* replace file by temporary file */
@@ -604,8 +604,8 @@ bst_file_dialog_popup_save_project (gpointer parent_widget,
gboolean apply_project_name)
{
/* handle non-popup case */
- const gchar *filename = bse_proxy_get_data (project, "beast-project-file-name");
- gboolean store_references = (int) bse_proxy_get_data (project, "beast-project-store-references");
+ const char *filename = (const char*) bse_proxy_get_data (project, "beast-project-file-name");
+ bool store_references = size_t (bse_proxy_get_data (project, "beast-project-store-references"));
if (filename && !query_project_name)
{
gboolean handled = bst_file_dialog_save_project (project, !store_references, filename, FALSE, TRUE);
@@ -785,7 +785,7 @@ bst_file_dialog_load_wave (BstFileDialog *self,
GtkWidget*
bst_file_dialog_create (void)
{
- BstFileDialog *self = g_object_new (BST_TYPE_FILE_DIALOG, NULL);
+ BstFileDialog *self = (BstFileDialog*) g_object_new (BST_TYPE_FILE_DIALOG, NULL);
bst_file_dialog_set_mode (self, NULL,
BST_FILE_DIALOG_SELECT_FILE,
"File Selector", 0);
@@ -920,6 +920,7 @@ bst_file_dialog_activate (BstFileDialog *self)
case BST_FILE_DIALOG_LOAD_WAVE_LIB:
popdown = bst_file_dialog_load_wave (self, file_name);
break;
+ default: ;
}
if (swin)
gxk_status_window_pop ();
diff --git a/beast-gtk/bstfiledialog.h b/beast-gtk/bstfiledialog.h
index 1705023..ab0280c 100644
--- a/beast-gtk/bstfiledialog.h
+++ b/beast-gtk/bstfiledialog.h
@@ -129,4 +129,13 @@ void bst_file_dialog_set_handler (BstFileDialog *self,
G_END_DECLS
+// == Flags Enumeration Operators in C++ ==
+#ifdef __cplusplus
+inline BstFileDialogMode operator& (BstFileDialogMode s1, BstFileDialogMode s2) { return BstFileDialogMode (s1 & (long long unsigned) s2); }
+inline BstFileDialogMode& operator&= (BstFileDialogMode &s1, BstFileDialogMode s2) { s1 = s1 & s2; return s1; }
+inline BstFileDialogMode operator| (BstFileDialogMode s1, BstFileDialogMode s2) { return BstFileDialogMode (s1 | (long long unsigned) s2); }
+inline BstFileDialogMode& operator|= (BstFileDialogMode &s1, BstFileDialogMode s2) { s1 = s1 | s2; return s1; }
+inline BstFileDialogMode operator~ (BstFileDialogMode s1) { return BstFileDialogMode (~(long long unsigned) s1); }
+#endif // __cplusplus
+
#endif /* __BST_FILE_DIALOG_H__ */
diff --git a/beast-gtk/bstgconfig.c b/beast-gtk/bstgconfig.cc
similarity index 97%
rename from beast-gtk/bstgconfig.c
rename to beast-gtk/bstgconfig.cc
index 851e05a..8d7715a 100644
--- a/beast-gtk/bstgconfig.c
+++ b/beast-gtk/bstgconfig.cc
@@ -137,7 +137,7 @@ accel_map_print (gpointer data,
gboolean changed)
{
GString *gstring = g_string_new (changed ? NULL : "; ");
- SfiWStore *wstore = data;
+ SfiWStore *wstore = (SfiWStore*) data;
gchar *tmp, *name;
g_string_append (gstring, "(gtk_accel_path \"");
@@ -148,7 +148,7 @@ accel_map_print (gpointer data,
g_string_append (gstring, "\" \"");
- name = gtk_accelerator_name (accel_key, accel_mods);
+ name = gtk_accelerator_name (accel_key, GdkModifierType (accel_mods));
tmp = g_strescape (name, NULL);
g_free (name);
g_string_append (gstring, tmp);
@@ -197,7 +197,7 @@ bst_rc_dump (const gchar *file_name)
sfi_wstore_puts (wstore, "\n; Gtk+ Accel Map Path Dump\n");
sfi_wstore_puts (wstore, "(menu-accelerators ");
sfi_wstore_push_level (wstore);
- gtk_accel_map_foreach (wstore, accel_map_print);
+ gtk_accel_map_foreach (wstore, GtkAccelMapForeach (accel_map_print));
sfi_wstore_break (wstore); /* make sure this is no comment line */
sfi_wstore_puts (wstore, ")\n");
sfi_wstore_pop_level (wstore);
@@ -234,7 +234,7 @@ rc_file_try_statement (gpointer context_data,
g_scanner_get_next_token (rstore->scanner); /* eat identifier */
gtk_accel_map_load_scanner (scanner);
if (g_scanner_get_next_token (scanner) != ')')
- return ')';
+ return GTokenType (')');
else
return G_TOKEN_NONE;
}
diff --git a/beast-gtk/bstgrowbar.c b/beast-gtk/bstgrowbar.cc
similarity index 80%
rename from beast-gtk/bstgrowbar.c
rename to beast-gtk/bstgrowbar.cc
index d429e1f..fa2245b 100644
--- a/beast-gtk/bstgrowbar.c
+++ b/beast-gtk/bstgrowbar.cc
@@ -36,7 +36,7 @@ G_DEFINE_DATA_TYPE (BstGrowBar, bst_grow_bar, GTK_TYPE_ALIGNMENT);
static void
bst_grow_bar_init (BstGrowBar *self,
- BstGrowBarClass *class)
+ BstGrowBarClass *klass)
{
g_object_set (self,
"visible", 1,
@@ -44,40 +44,40 @@ bst_grow_bar_init (BstGrowBar *self,
"yscale", 1.0,
NULL);
self->max_upper = G_MAXINT;
- GtkBox *box = g_object_new (class->is_horizontal ? GTK_TYPE_HBOX : GTK_TYPE_VBOX,
+ GtkBox *box = (GtkBox*) g_object_new (klass->is_horizontal ? GTK_TYPE_HBOX : GTK_TYPE_VBOX,
"visible", 1,
"parent", self,
NULL);
- self->growb = g_object_new (GTK_TYPE_BUTTON,
- "visible", 1,
- "can-focus", 0,
- NULL);
+ self->growb = (GtkWidget*) g_object_new (GTK_TYPE_BUTTON,
+ "visible", 1,
+ "can-focus", 0,
+ NULL);
g_object_ref (self->growb);
g_signal_connect (self->growb, "clicked", G_CALLBACK (grow_range), self);
- GtkWidget *sign = g_object_new (GTK_TYPE_ALIGNMENT,
+ GtkWidget *sign = (GtkWidget*) g_object_new (GTK_TYPE_ALIGNMENT,
"visible", 1,
"parent", self->growb,
NULL);
g_signal_connect_after (sign, "expose-event", G_CALLBACK (draw_grow_sign), self);
- self->shrinkb = g_object_new (GTK_TYPE_BUTTON,
- "visible", 1,
- "can-focus", 0,
- NULL);
+ self->shrinkb = (GtkWidget*) g_object_new (GTK_TYPE_BUTTON,
+ "visible", 1,
+ "can-focus", 0,
+ NULL);
g_object_ref (self->shrinkb);
g_signal_connect (self->shrinkb, "clicked", G_CALLBACK (shrink_range), self);
- sign = g_object_new (GTK_TYPE_ALIGNMENT,
- "visible", 1,
- "parent", self->shrinkb,
- NULL);
+ sign = (GtkWidget*) g_object_new (GTK_TYPE_ALIGNMENT,
+ "visible", 1,
+ "parent", self->shrinkb,
+ NULL);
g_signal_connect_after (sign, "expose-event", G_CALLBACK (draw_shrink_sign), self);
gtk_box_pack_start (box, self->shrinkb, FALSE, TRUE, 0);
- self->range = g_object_new (class->is_horizontal ? GTK_TYPE_HSCROLLBAR : GTK_TYPE_VSCROLLBAR,
- "visible", 1,
- "parent", box,
- NULL);
+ self->range = (GtkRange*) g_object_new (klass->is_horizontal ? GTK_TYPE_HSCROLLBAR : GTK_TYPE_VSCROLLBAR,
+ "visible", 1,
+ "parent", box,
+ NULL);
g_object_ref (self->range);
gtk_box_pack_start (box, self->growb, FALSE, TRUE, 0);
- if (class->is_horizontal)
+ if (klass->is_horizontal)
{
gxk_widget_request_vclient_width (self->growb, GTK_WIDGET (self->range));
gxk_widget_request_vclient_width (self->shrinkb, GTK_WIDGET (self->range));
@@ -105,11 +105,11 @@ bst_grow_bar_finalize (GObject *object)
}
static void
-bst_grow_bar_class_init (BstGrowBarClass *class,
+bst_grow_bar_class_init (BstGrowBarClass *klass,
gpointer class_data)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (class);
- // GtkBarClass *bar_class = GTK_BAR_CLASS (class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ // GtkBarClass *bar_class = GTK_BAR_CLASS (klass);
gobject_class->finalize = bst_grow_bar_finalize;
}
@@ -208,9 +208,9 @@ bst_hgrow_bar_init (BstHGrowBar *self)
}
static void
-bst_hgrow_bar_class_init (BstHGrowBarClass *class)
+bst_hgrow_bar_class_init (BstHGrowBarClass *klass)
{
- BstGrowBarClass *grow_bar_class = BST_GROW_BAR_CLASS (class);
+ BstGrowBarClass *grow_bar_class = BST_GROW_BAR_CLASS (klass);
grow_bar_class->is_horizontal = TRUE;
}
@@ -224,8 +224,8 @@ bst_vgrow_bar_init (BstVGrowBar *self)
}
static void
-bst_vgrow_bar_class_init (BstVGrowBarClass *class)
+bst_vgrow_bar_class_init (BstVGrowBarClass *klass)
{
- BstGrowBarClass *grow_bar_class = BST_GROW_BAR_CLASS (class);
+ BstGrowBarClass *grow_bar_class = BST_GROW_BAR_CLASS (klass);
grow_bar_class->is_horizontal = FALSE;
}
diff --git a/beast-gtk/bstitemseqdialog.c b/beast-gtk/bstitemseqdialog.cc
similarity index 93%
rename from beast-gtk/bstitemseqdialog.c
rename to beast-gtk/bstitemseqdialog.cc
index 3b389b2..c88edaf 100644
--- a/beast-gtk/bstitemseqdialog.c
+++ b/beast-gtk/bstitemseqdialog.cc
@@ -97,12 +97,12 @@ bst_item_seq_dialog_setup (BstItemSeqDialog *self,
/* cleanup connections to old parent_window */
if (self->parent_window)
- g_signal_handlers_disconnect_by_func (self->parent_window, parent_window_destroyed, self);
+ g_signal_handlers_disconnect_by_func (self->parent_window, (void*) parent_window_destroyed, self);
if (window->group)
gtk_window_group_remove_window (window->group, window);
gtk_window_set_transient_for (window, NULL);
- self->parent_window = parent_widget ? (GtkWindow*) gtk_widget_get_ancestor (parent_widget, GTK_TYPE_WINDOW) : NULL;
+ self->parent_window = parent_widget ? (GtkWindow*) gtk_widget_get_ancestor ((GtkWidget*) parent_widget, GTK_TYPE_WINDOW) : NULL;
/* setup connections to new parent_window */
if (self->parent_window)
@@ -124,7 +124,7 @@ bst_item_seq_dialog_singleton (void)
{
static BstItemSeqDialog *ts_singleton = NULL;
if (!ts_singleton)
- ts_singleton = g_object_new (BST_TYPE_ITEM_SEQ_DIALOG, NULL);
+ ts_singleton = (BstItemSeqDialog*) g_object_new (BST_TYPE_ITEM_SEQ_DIALOG, NULL);
return ts_singleton;
}
@@ -196,10 +196,10 @@ bst_item_seq_dialog_sensitize_idle (gpointer data)
GDK_THREADS_ENTER();
GxkRadget *radget = gxk_dialog_get_child (GXK_DIALOG (self));
GtkWidget *button;
- button = gxk_radget_find (radget, "button-add");
+ button = (GtkWidget*) gxk_radget_find (radget, "button-add");
if (button)
gtk_widget_set_sensitive (button, gtk_tree_selection_get_selected (self->candidate_sel, NULL, NULL));
- button = gxk_radget_find (radget, "button-remove");
+ button = (GtkWidget*) gxk_radget_find (radget, "button-remove");
if (button)
gtk_widget_set_sensitive (button, gtk_tree_selection_get_selected (self->item_sel, NULL, NULL));
gboolean can_raise = FALSE, can_lower = FALSE;
@@ -210,10 +210,10 @@ bst_item_seq_dialog_sensitize_idle (gpointer data)
can_lower = bst_item_seq_store_can_lower (self->item_store, proxy);
can_raise = bst_item_seq_store_can_raise (self->item_store, proxy);
}
- button = gxk_radget_find (radget, "button-up");
+ button = (GtkWidget*) gxk_radget_find (radget, "button-up");
if (button)
gtk_widget_set_sensitive (button, can_raise);
- button = gxk_radget_find (radget, "button-down");
+ button = (GtkWidget*) gxk_radget_find (radget, "button-down");
if (button)
gtk_widget_set_sensitive (button, can_lower);
g_object_unref (self);
@@ -330,11 +330,11 @@ bst_item_seq_dialog_init (BstItemSeqDialog *self)
/* dialog contents */
GxkRadget *radget = gxk_radget_create ("beast", "item-seq-box", NULL);
- gxk_dialog_set_child (GXK_DIALOG (self), radget);
+ gxk_dialog_set_child (GXK_DIALOG (self), (GtkWidget*) radget);
/* candidate store and selection setup */
self->candidate_store = bst_item_seq_store_new (TRUE);
- tview = gxk_radget_find (radget, "candidate-view");
+ tview = (GtkTreeView*) gxk_radget_find (radget, "candidate-view");
g_object_set (tview, "model", self->candidate_store, "search_column", BST_PROXY_STORE_NAME, NULL);
self->candidate_sel = gtk_tree_view_get_selection (tview);
gtk_tree_selection_set_mode (self->candidate_sel, GTK_SELECTION_BROWSE);
@@ -356,7 +356,7 @@ bst_item_seq_dialog_init (BstItemSeqDialog *self)
/* item store and selection setup */
self->item_store = bst_item_seq_store_new (FALSE);
- tview = gxk_radget_find (radget, "item-view");
+ tview = (GtkTreeView*) gxk_radget_find (radget, "item-view");
g_object_set (tview, "model", self->item_store, "search_column", BST_PROXY_STORE_NAME, NULL);
self->item_sel = gtk_tree_view_get_selection (tview);
gtk_tree_selection_set_mode (self->item_sel, GTK_SELECTION_BROWSE);
@@ -375,10 +375,10 @@ bst_item_seq_dialog_init (BstItemSeqDialog *self)
NULL, NULL, G_CONNECT_SWAPPED);
/* make row connections */
g_signal_connect_object (tview, "row_activated", G_CALLBACK (gtk_button_clicked), gxk_radget_find (radget, "button-remove"), G_CONNECT_SWAPPED);
-
+
/* provide buttons */
- self->ok = gxk_dialog_default_action_swapped (GXK_DIALOG (self), BST_STOCK_OK, bst_item_seq_dialog_activate, self);
- gxk_dialog_action (GXK_DIALOG (self), BST_STOCK_CANCEL, gxk_toplevel_delete, self);
+ self->ok = gxk_dialog_default_action_swapped (GXK_DIALOG (self), BST_STOCK_OK, (void*) bst_item_seq_dialog_activate, self);
+ gxk_dialog_action (GXK_DIALOG (self), BST_STOCK_CANCEL, (void*) gxk_toplevel_delete, self);
/* connect buttons */
g_signal_connect_object (gxk_radget_find (radget, "button-add"), "clicked", G_CALLBACK (bst_item_seq_dialog_add), self, G_CONNECT_SWAPPED);
@@ -389,10 +389,10 @@ bst_item_seq_dialog_init (BstItemSeqDialog *self)
}
static void
-bst_item_seq_dialog_class_init (BstItemSeqDialogClass *class)
+bst_item_seq_dialog_class_init (BstItemSeqDialogClass *klass)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (class);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
gobject_class->finalize = bst_item_seq_dialog_finalize;
diff --git a/beast-gtk/bstitemview.c b/beast-gtk/bstitemview.cc
similarity index 93%
rename from beast-gtk/bstitemview.c
rename to beast-gtk/bstitemview.cc
index 59f93db..38454c6 100644
--- a/beast-gtk/bstitemview.c
+++ b/beast-gtk/bstitemview.cc
@@ -34,21 +34,21 @@ static void item_view_set_container (BstItemView *self,
G_DEFINE_TYPE (BstItemView, bst_item_view, GTK_TYPE_ALIGNMENT);
static void
-bst_item_view_class_init (BstItemViewClass *class)
+bst_item_view_class_init (BstItemViewClass *klass)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (class);
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
gobject_class->finalize = bst_item_view_finalize;
object_class->destroy = bst_item_view_destroy;
- class->item_type = NULL;
+ klass->item_type = NULL;
- class->listen_on = item_view_listen_on;
- class->unlisten_on = item_view_unlisten_on;
+ klass->listen_on = item_view_listen_on;
+ klass->unlisten_on = item_view_unlisten_on;
- class->set_container = item_view_set_container;
+ klass->set_container = item_view_set_container;
}
static void
@@ -126,7 +126,7 @@ item_view_listener (GtkTreeModel *model,
SfiProxy item,
gboolean added)
{
- BstItemView *self = g_object_get_data (model, "item-view");
+ BstItemView *self = (BstItemView*) g_object_get_data ((GObject*) model, "item-view");
if (added)
BST_ITEM_VIEW_GET_CLASS (self)->listen_on (self, item);
else
@@ -142,9 +142,9 @@ bst_item_view_adapt_list_wrapper (BstItemView *self,
g_return_val_if_fail (GXK_IS_LIST_WRAPPER (lwrapper), NULL);
g_return_val_if_fail (self->wlist == NULL, NULL);
- g_object_set_data (lwrapper, "item-view", self);
+ g_object_set_data ((GObject*) lwrapper, "item-view", self);
bst_child_list_wrapper_set_listener (lwrapper, item_view_listener);
- self->wlist = g_object_ref (lwrapper);
+ self->wlist = (GxkListWrapper*) g_object_ref (lwrapper);
return gtk_tree_model_sort_new_with_model (GTK_TREE_MODEL (self->wlist));
}
@@ -202,17 +202,17 @@ bst_item_view_complete_tree (BstItemView *self,
/* add list view columns */
gxk_tree_view_add_text_column (self->tree, BST_PROXY_STORE_SEQID, "S",
0.0, _("ID"), NULL,
- NULL, NULL, 0);
+ NULL, NULL, GConnectFlags (0));
gxk_tree_view_add_text_column (self->tree, BST_PROXY_STORE_NAME, "S",
0.0, _("Name"), NULL,
- bst_item_view_name_edited, self, G_CONNECT_SWAPPED);
+ (void*) bst_item_view_name_edited, self, G_CONNECT_SWAPPED);
gxk_tree_view_add_text_column (self->tree, BST_PROXY_STORE_BLURB, "",
0.0, _("Comment"), NULL,
- bst_item_view_blurb_edited, self, G_CONNECT_SWAPPED);
+ (void*) bst_item_view_blurb_edited, self, G_CONNECT_SWAPPED);
if (BST_DBG_EXT)
gxk_tree_view_add_text_column (self->tree, BST_PROXY_STORE_TYPE, "",
0.0, _("Type"), NULL,
- NULL, NULL, 0);
+ NULL, NULL, GConnectFlags (0));
/* sync to selection */
gxk_widget_update_actions (self);
}
diff --git a/beast-gtk/bstkeybindings.c b/beast-gtk/bstkeybindings.cc
similarity index 90%
rename from beast-gtk/bstkeybindings.c
rename to beast-gtk/bstkeybindings.cc
index 63b934d..2f5dd31 100644
--- a/beast-gtk/bstkeybindings.c
+++ b/beast-gtk/bstkeybindings.cc
@@ -83,8 +83,8 @@ key_bindings_load_file (GtkWidget *dialog,
gpointer data)
{
GtkWidget *self = GTK_WIDGET (data);
- BstKeyBinding *kbinding = g_object_get_data (self, "BstKeyBinding");
- GtkTreeView *btview = gxk_radget_find (self, "binding-tree-view");
+ BstKeyBinding *kbinding = (BstKeyBinding*) g_object_get_data ((GObject*) self, "BstKeyBinding");
+ GtkTreeView *btview = (GtkTreeView*) gxk_radget_find (self, "binding-tree-view");
GtkTreeModel *model = gtk_tree_view_get_model (btview);
GSList slist = { kbinding, NULL };
BseErrorType error = bst_key_binding_parse (file, &slist);
@@ -99,9 +99,9 @@ key_bindings_exec_action (gpointer data,
gulong action)
{
GtkWidget *self = GTK_WIDGET (data);
- BstKeyBinding *kbinding = g_object_get_data (self, "BstKeyBinding");
- GtkTreeView *btview = gxk_radget_find (self, "binding-tree-view");
- GtkTreeView *ftview = gxk_radget_find (self, "function-tree-view");
+ BstKeyBinding *kbinding = (BstKeyBinding*) g_object_get_data ((GObject*) self, "BstKeyBinding");
+ GtkTreeView *btview = (GtkTreeView*) gxk_radget_find (self, "binding-tree-view");
+ GtkTreeView *ftview = (GtkTreeView*) gxk_radget_find (self, "function-tree-view");
gxk_status_window_push (self);
switch (action)
{
@@ -131,7 +131,7 @@ key_bindings_exec_action (gpointer data,
valid &= key_binding_find_key (kbinding, keyval, modifier, kbinding->funcs[nf].collision_group, ~0) >= kbinding->n_keys;
if (valid)
{
- kbinding->keys = g_realloc (kbinding->keys, sizeof (kbinding->keys[0]) * (kbinding->n_keys + 1));
+ kbinding->keys = (BstKeyBindingKey*) g_realloc (kbinding->keys, sizeof (kbinding->keys[0]) * (kbinding->n_keys + 1));
g_memmove (kbinding->keys + nb + 1,
kbinding->keys + nb,
sizeof (kbinding->keys[0]) * (kbinding->n_keys - nb));
@@ -252,8 +252,8 @@ key_bindings_check_action (gpointer data,
{
GtkWidget *self = GTK_WIDGET (data);
gboolean editable = g_object_get_long (self, "editable");
- GtkTreeView *btview = gxk_radget_find (self, "binding-tree-view");
- GtkTreeView *ftview = gxk_radget_find (self, "function-tree-view");
+ GtkTreeView *btview = (GtkTreeView*) gxk_radget_find (self, "binding-tree-view");
+ GtkTreeView *ftview = (GtkTreeView*) gxk_radget_find (self, "function-tree-view");
if (!editable)
return FALSE;
switch (action)
@@ -298,7 +298,7 @@ key_binding_binding_param_edited (GtkWidget *self,
const gchar *strpath,
const gchar *text)
{
- BstKeyBinding *kbinding = g_object_get_data (self, "BstKeyBinding");
+ BstKeyBinding *kbinding = (BstKeyBinding*) g_object_get_data ((GObject*) self, "BstKeyBinding");
guint nb = strpath ? gxk_tree_spath_index0 (strpath) : G_MAXUINT;
BstKeyBindingParam ptype = kbinding->funcs[kbinding->keys[nb].func_index].ptype;
gdouble value = 0;
@@ -327,7 +327,7 @@ key_binding_fill_binding_value (GtkWidget *self,
GValue *value,
GxkListWrapper *lwrapper)
{
- BstKeyBinding *kbinding = g_object_get_data (self, "BstKeyBinding");
+ BstKeyBinding *kbinding = (BstKeyBinding*) g_object_get_data ((GObject*) self, "BstKeyBinding");
gint nb = row;
if (nb >= kbinding->n_keys)
{
@@ -369,7 +369,7 @@ key_binding_fill_function_value (GtkWidget *self,
GValue *value,
GxkListWrapper *lwrapper)
{
- BstKeyBinding *kbinding = g_object_get_data (self, "BstKeyBinding");
+ BstKeyBinding *kbinding = (BstKeyBinding*) g_object_get_data ((GObject*) self, "BstKeyBinding");
switch (column)
{
case FCOL_NAME:
@@ -384,7 +384,7 @@ key_binding_fill_function_value (GtkWidget *self,
static void
key_binding_free (gpointer data)
{
- BstKeyBinding *kbinding = data;
+ BstKeyBinding *kbinding = (BstKeyBinding*) data;
g_free (kbinding->binding_name);
g_free (kbinding->keys);
g_free (kbinding);
@@ -405,7 +405,7 @@ bst_key_binding_box (const gchar *binding_name,
kbinding->n_funcs = n_funcs;
kbinding->funcs = funcs;
- g_object_set_data_full (self, "BstKeyBinding", kbinding, key_binding_free);
+ g_object_set_data_full ((GObject*) self, "BstKeyBinding", kbinding, key_binding_free);
g_object_set_long (self, "editable", editable != FALSE);
gxk_widget_publish_actions (self, "key-bindings-actions", G_N_ELEMENTS (key_bindings_actions), key_bindings_actions,
NULL, key_bindings_check_action, key_bindings_exec_action);
@@ -422,7 +422,7 @@ bst_key_binding_box (const gchar *binding_name,
gxk_list_wrapper_notify_append (lwrapper, kbinding->n_keys);
/* binding view setup */
- tview = gxk_radget_find (self, "binding-tree-view");
+ tview = (GtkTreeView*) gxk_radget_find (self, "binding-tree-view");
gtk_tree_view_set_model (tview, GTK_TREE_MODEL (lwrapper));
tsel = gtk_tree_view_get_selection (tview);
g_signal_connect_swapped (tsel, "changed", G_CALLBACK (gxk_widget_update_actions), tview);
@@ -430,13 +430,13 @@ bst_key_binding_box (const gchar *binding_name,
gxk_tree_selection_force_browse (tsel, GTK_TREE_MODEL (lwrapper));
gxk_tree_view_add_text_column (tview, BCOL_KEY, "S", 0.0, _("Key Binding"),
_("Key combinations used to activate a function"),
- NULL, NULL, 0);
+ NULL, NULL, GConnectFlags (0));
gxk_tree_view_add_text_column (tview, BCOL_FUNCTION, "S", 0.0, _("Function"),
_("Functions to be activated for a key binding"),
- NULL, NULL, 0);
+ NULL, NULL, GConnectFlags (0));
gxk_tree_view_add_text_column (tview, BCOL_PARAM, "S", 0.0, _("Parameter"),
_("Parameter to pass to functions upon activation"),
- editable ? key_binding_binding_param_edited : NULL, self, G_CONNECT_SWAPPED);
+ editable ? (void*) key_binding_binding_param_edited : NULL, self, G_CONNECT_SWAPPED);
/* function list */
lwrapper = gxk_list_wrapper_new (N_FCOLS,
@@ -447,9 +447,9 @@ bst_key_binding_box (const gchar *binding_name,
G_CALLBACK (key_binding_fill_function_value),
self, G_CONNECT_SWAPPED);
gxk_list_wrapper_notify_append (lwrapper, kbinding->n_funcs);
-
+
/* function view setup */
- tview = gxk_radget_find (self, "function-tree-view");
+ tview = (GtkTreeView*) gxk_radget_find (self, "function-tree-view");
gtk_tree_view_set_model (tview, GTK_TREE_MODEL (lwrapper));
tsel = gtk_tree_view_get_selection (tview);
g_signal_connect_swapped (tsel, "changed", G_CALLBACK (gxk_widget_update_actions), tview);
@@ -457,18 +457,18 @@ bst_key_binding_box (const gchar *binding_name,
gxk_tree_selection_force_browse (tsel, GTK_TREE_MODEL (lwrapper));
gxk_tree_view_add_text_column (tview, FCOL_NAME, "S", 0.0, _("Function"),
_("Function used to create new key bindings"),
- NULL, NULL, 0);
- gxk_tree_view_add_text_column (tview, FCOL_BLURB, "S", 0.0, _("Description"), NULL, NULL, NULL, 0);
-
- return self;
+ NULL, NULL, GConnectFlags (0));
+ gxk_tree_view_add_text_column (tview, FCOL_BLURB, "S", 0.0, _("Description"), NULL, NULL, NULL, GConnectFlags (0));
+
+ return (GtkWidget*) self;
}
void
bst_key_binding_box_set (GtkWidget *self,
BstKeyBindingItemSeq *kbseq)
{
- BstKeyBinding *kbinding = g_object_get_data (self, "BstKeyBinding");
- GtkTreeView *btview = gxk_radget_find (self, "binding-tree-view");
+ BstKeyBinding *kbinding = (BstKeyBinding*) g_object_get_data ((GObject*) self, "BstKeyBinding");
+ GtkTreeView *btview = (GtkTreeView*) gxk_radget_find (self, "binding-tree-view");
GtkTreeModel *model = gtk_tree_view_get_model (btview);
bst_key_binding_set_item_seq (kbinding, kbseq);
gxk_list_wrapper_notify_clear (GXK_LIST_WRAPPER (model));
@@ -478,7 +478,7 @@ bst_key_binding_box_set (GtkWidget *self,
BstKeyBindingItemSeq*
bst_key_binding_box_get (GtkWidget *self)
{
- BstKeyBinding *kbinding = g_object_get_data (self, "BstKeyBinding");
+ BstKeyBinding *kbinding = (BstKeyBinding*) g_object_get_data ((GObject*) self, "BstKeyBinding");
return bst_key_binding_get_item_seq (kbinding);
}
@@ -543,7 +543,7 @@ bst_key_binding_set_item_seq (BstKeyBinding *kbinding,
/* reset */
kbinding->n_keys = 0;
/* raise capacity */
- kbinding->keys = g_realloc (kbinding->keys, sizeof (kbinding->keys[0]) * seq->n_items);
+ kbinding->keys = (BstKeyBindingKey*) g_realloc (kbinding->keys, sizeof (kbinding->keys[0]) * seq->n_items);
/* convert picewise */
key = kbinding->keys;
for (i = 0; i < seq->n_items; i++)
@@ -561,7 +561,7 @@ bst_key_binding_set_item_seq (BstKeyBinding *kbinding,
/* admit registration */
kbinding->n_keys = key - kbinding->keys;
/* shrink capacity */
- kbinding->keys = g_realloc (kbinding->keys, sizeof (kbinding->keys[0]) * kbinding->n_keys);
+ kbinding->keys = (BstKeyBindingKey*) g_realloc (kbinding->keys, sizeof (kbinding->keys[0]) * kbinding->n_keys);
}
BstKeyBindingItemSeq*
@@ -574,7 +574,7 @@ bst_key_binding_get_item_seq (BstKeyBinding *kbinding)
BstKeyBindingKey *key = kbinding->keys + i;
BstKeyBindingItem item;
item.key_name = gtk_accelerator_name (key->keyval, key->modifier);
- item.func_name = kbinding->funcs[key->func_index].function_name;
+ item.func_name = (char*) kbinding->funcs[key->func_index].function_name;
item.func_param = key->param;
bst_key_binding_item_seq_append (iseq, &item);
g_free (item.key_name);
@@ -636,7 +636,7 @@ bst_key_binding_dump (const gchar *file_name,
sfi_wstore_puts (wstore, "\n");
for (slist = kbindings; slist; slist = slist->next)
{
- BstKeyBinding *kbinding = slist->data;
+ BstKeyBinding *kbinding = (BstKeyBinding*) slist->data;
BstKeyBindingItemSeq *iseq = bst_key_binding_get_item_seq (kbinding);
GParamSpec *pspec = sfi_pspec_seq (kbinding->binding_name, NULL, NULL, bst_key_binding_item_pspec(), SFI_PARAM_STANDARD);
SfiSeq *seq = bst_key_binding_item_seq_to_seq (iseq);
@@ -662,11 +662,11 @@ key_binding_try_statement (gpointer context_data,
GScanner *scanner,
gpointer user_data)
{
- GSList *slist, *kbindings = context_data;
+ GSList *slist, *kbindings = (GSList*) context_data;
g_assert (scanner->next_token == G_TOKEN_IDENTIFIER);
for (slist = kbindings; slist; slist = slist->next)
{
- BstKeyBinding *kbinding = slist->data;
+ BstKeyBinding *kbinding = (BstKeyBinding*) slist->data;
if (strcmp (kbinding->binding_name, scanner->next_value.v_identifier) == 0)
{
GParamSpec *pspec = sfi_pspec_seq (kbinding->binding_name, NULL, NULL, bst_key_binding_item_pspec(), SFI_PARAM_STANDARD);
diff --git a/beast-gtk/bstkeybindings.h b/beast-gtk/bstkeybindings.h
index 153c8cc..8e8fe29 100644
--- a/beast-gtk/bstkeybindings.h
+++ b/beast-gtk/bstkeybindings.h
@@ -36,9 +36,9 @@ typedef enum /*< skip >*/
} BstKeyBindingParam;
typedef struct {
guint id;
- gchar *function_name;
+ const char *function_name;
BstKeyBindingParam ptype;
- gchar *function_blurb; /* translated */
+ const char *function_blurb; /* translated */
guint collision_group;
} BstKeyBindingFunction;
typedef struct {
diff --git a/beast-gtk/bstknob.c b/beast-gtk/bstknob.cc
similarity index 98%
rename from beast-gtk/bstknob.c
rename to beast-gtk/bstknob.cc
index 8f01e3e..bf35b79 100644
--- a/beast-gtk/bstknob.c
+++ b/beast-gtk/bstknob.cc
@@ -612,7 +612,7 @@ bst_knob_init (BstKnob *knob)
knob->old_upper = 0.0;
knob->old_page_size = 0.0;
knob->adjustment = NULL;
- knob->pixbuf = g_object_ref (bst_pixbuf_knob ());
+ knob->pixbuf = (GdkPixbuf*) g_object_ref (bst_pixbuf_knob ());
g_assert (knob->pixbuf);
gtk_image_set_from_pixbuf (GTK_IMAGE (knob), knob->pixbuf);
@@ -626,10 +626,10 @@ bst_knob_init (BstKnob *knob)
}
static void
-bst_knob_class_init (BstKnobClass *class)
+bst_knob_class_init (BstKnobClass *klass)
{
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
object_class->destroy = bst_knob_destroy;
diff --git a/beast-gtk/bstlogadjustment.c b/beast-gtk/bstlogadjustment.cc
similarity index 92%
rename from beast-gtk/bstlogadjustment.c
rename to beast-gtk/bstlogadjustment.cc
index 54b7745..0fc05d6 100644
--- a/beast-gtk/bstlogadjustment.c
+++ b/beast-gtk/bstlogadjustment.cc
@@ -32,10 +32,10 @@ static void ladj_client_value_changed (BstLogAdjustment *ladj);
G_DEFINE_TYPE (BstLogAdjustment, bst_log_adjustment, GTK_TYPE_ADJUSTMENT);
static void
-bst_log_adjustment_class_init (BstLogAdjustmentClass *class)
+bst_log_adjustment_class_init (BstLogAdjustmentClass *klass)
{
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
- GtkAdjustmentClass *adjustment_class = GTK_ADJUSTMENT_CLASS (class);
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
+ GtkAdjustmentClass *adjustment_class = GTK_ADJUSTMENT_CLASS (klass);
object_class->destroy = bst_log_adjustment_destroy;
@@ -83,7 +83,7 @@ bst_log_adjustment_from_adj (GtkAdjustment *client)
g_return_val_if_fail (GTK_IS_ADJUSTMENT (client), NULL);
- ladj = g_object_new (BST_TYPE_LOG_ADJUSTMENT, NULL);
+ ladj = (BstLogAdjustment*) g_object_new (BST_TYPE_LOG_ADJUSTMENT, NULL);
bst_log_adjustment_set_client (ladj, client);
return GTK_ADJUSTMENT (ladj);
@@ -100,8 +100,8 @@ bst_log_adjustment_set_client (BstLogAdjustment *ladj,
g_object_ref (ladj);
if (ladj->client)
{
- g_signal_handlers_disconnect_by_func (ladj->client, ladj_adjust_ranges, ladj);
- g_signal_handlers_disconnect_by_func (ladj->client, ladj_client_value_changed, ladj);
+ g_signal_handlers_disconnect_by_func (ladj->client, (void*) ladj_adjust_ranges, ladj);
+ g_signal_handlers_disconnect_by_func (ladj->client, (void*) ladj_client_value_changed, ladj);
g_object_unref (G_OBJECT (ladj->client));
}
ladj->client = client;
diff --git a/beast-gtk/bstmain.c b/beast-gtk/bstmain.cc
similarity index 97%
rename from beast-gtk/bstmain.c
rename to beast-gtk/bstmain.cc
index 08bc715..3a8abf0 100644
--- a/beast-gtk/bstmain.c
+++ b/beast-gtk/bstmain.cc
@@ -35,6 +35,8 @@
#include <sys/resource.h>
// #include "sfi/toyprof-mem.h"
+extern "C" void bse_object_debug_leaks (void); // FIXME
+
/* --- prototypes --- */
static void bst_early_parse_args (gint *argc_p,
@@ -70,8 +72,8 @@ server_registration (SfiProxy server,
registration_done = TRUE;
else
{
- gchar *base = strrchr (what, '/');
- bst_splash_update_item (data, "%s", base ? base + 1 : what);
+ const char *base = strrchr (what, '/');
+ bst_splash_update_item ((GtkWidget*) data, "%s", base ? base + 1 : what);
if (error && error[0])
g_message ("failed to register \"%s\": %s", what, error);
}
@@ -224,8 +226,8 @@ main (int argc,
}
/* debugging hook */
- string = g_getenv ("BEAST_SLEEP4GDB");
- if (string && atoi (string) > 0)
+ const char *estring = g_getenv ("BEAST_SLEEP4GDB");
+ if (estring && atoi (estring) > 0)
{
bst_splash_update_entity (beast_splash, "Debugging Hook");
g_message ("going into sleep mode due to debugging request (pid=%u)", getpid ());
@@ -315,7 +317,7 @@ main (int argc,
BseErrorType error = bst_project_restore_from_file (project, argv[i], TRUE, TRUE);
if (!error || error == BSE_ERROR_FILE_NOT_FOUND)
{
- error = 0;
+ error = BseErrorType (0);
app = bst_app_new (project);
gxk_idle_show_widget (GTK_WIDGET (app));
gtk_widget_hide (beast_splash);
@@ -380,7 +382,7 @@ main (int argc,
"</tag-span-markup>";
GtkWidget *sctext = gxk_scroll_text_create (GXK_SCROLL_TEXT_WRAP | GXK_SCROLL_TEXT_SANS | GXK_SCROLL_TEXT_CENTER, NULL);
gxk_scroll_text_set_tsm (sctext, release_notes_contents);
- GtkWidget *rndialog = gxk_dialog_new (NULL, NULL, GXK_DIALOG_DELETE_BUTTON, release_notes_title, sctext);
+ GtkWidget *rndialog = (GtkWidget*) gxk_dialog_new (NULL, NULL, GXK_DIALOG_DELETE_BUTTON, release_notes_title, sctext);
gxk_dialog_set_sizes (GXK_DIALOG (rndialog), 320, 200, 540, 420);
gxk_scroll_text_rewind (sctext);
gxk_idle_show_widget (rndialog);
@@ -497,8 +499,8 @@ bst_early_parse_args (int *argc_p,
register_scripts = FALSE;
if (strchr (flags, 'f'))
{
- GLogLevelFlags fatal_mask = g_log_set_always_fatal (G_LOG_FATAL_MASK);
- fatal_mask |= G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL;
+ GLogLevelFlags fatal_mask = g_log_set_always_fatal (GLogLevelFlags (G_LOG_FATAL_MASK));
+ fatal_mask = GLogLevelFlags (fatal_mask | G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL);
g_log_set_always_fatal (fatal_mask);
}
if (strchr (flags, 'd') != NULL)
@@ -589,14 +591,14 @@ bst_early_parse_args (int *argc_p,
else if (strcmp ("--skinrc", argv[i]) == 0 ||
strncmp ("--skinrc=", argv[i], 9) == 0)
{
- gchar *arg = argv[i][9 - 1] == '=' ? argv[i] + 9 : (argv[i + 1] ? argv[i + 1] : "");
+ const char *arg = argv[i][9 - 1] == '=' ? argv[i] + 9 : (argv[i + 1] ? argv[i + 1] : "");
bst_skin_config_set_rcfile (arg);
}
else if (strcmp ("--print-dir", argv[i]) == 0 ||
strncmp ("--print-dir=", argv[i], 12) == 0)
{
- gchar *arg = argv[i][12 - 1] == '=' ? argv[i] + 12 : (argv[i + 1] ? argv[i + 1] : "");
- gchar *freeme = NULL;
+ const char *arg = argv[i][12 - 1] == '=' ? argv[i] + 12 : (argv[i + 1] ? argv[i + 1] : "");
+ char *freeme = NULL;
if (strcmp (arg, "prefix") == 0)
g_print ("%s\n", BST_PATH_PREFIX);
else if (strcmp (arg, "docs") == 0)
diff --git a/beast-gtk/bstmenus.c b/beast-gtk/bstmenus.cc
similarity index 95%
rename from beast-gtk/bstmenus.c
rename to beast-gtk/bstmenus.cc
index 646a834..7f4335d 100644
--- a/beast-gtk/bstmenus.c
+++ b/beast-gtk/bstmenus.cc
@@ -148,7 +148,7 @@ bst_choice_menu_add_choice_and_free (GtkWidget *menu,
if (choice_type == BST_CHOICE_TYPE_SUBMENU)
gxk_menu_attach_as_submenu (GTK_MENU (choice->p_id), GTK_MENU_ITEM (item));
else
- menu_item_add_activator (item, menu_choice_activate);
+ menu_item_add_activator (item, (void*) menu_choice_activate);
if (choice->name)
{
GtkWidget *any;
@@ -184,7 +184,7 @@ bst_choice_menu_set_item_sensitive (GtkWidget *menu,
{
if (id == (gulong) gtk_object_get_user_data (GTK_OBJECT (list->data)))
{
- gtk_widget_set_sensitive (list->data, sensitive);
+ gtk_widget_set_sensitive ((GtkWidget*) list->data, sensitive);
return;
}
}
@@ -199,17 +199,16 @@ bst_choice_menu_createv (const gchar *menu_path,
BstChoice *choice;
GtkWidget *menu;
va_list args;
-
va_start (args, first_choice);
-
- menu = g_object_connect (gtk_widget_new (GTK_TYPE_MENU,
- NULL),
- "signal::selection-done", check_modal_quit, NULL,
- NULL);
+
+ menu = gtk_widget_new (GTK_TYPE_MENU, NULL);
+ g_object_connect (menu,
+ "signal::selection-done", check_modal_quit, NULL,
+ NULL);
gtk_menu_set_accel_path (GTK_MENU (menu), menu_path);
gtk_widget_ref (menu);
gtk_object_sink (GTK_OBJECT (menu));
-
+
choice = first_choice;
while (choice)
{
@@ -272,14 +271,13 @@ bst_choice_dialog_createv (BstChoice *first_choice,
}
while (choice);
va_end (args);
-
+
/* create dialog
*/
- dialog = gxk_dialog_new (NULL, NULL, GXK_DIALOG_POPUP_POS | GXK_DIALOG_MODAL,
- NULL, vbox);
+ dialog = (GtkWidget*) gxk_dialog_new (NULL, NULL, GXK_DIALOG_POPUP_POS | GXK_DIALOG_MODAL, NULL, vbox);
gtk_widget_ref (dialog);
gtk_object_sink (GTK_OBJECT (dialog));
-
+
/* add items
*/
va_start (args, first_choice);
@@ -297,9 +295,9 @@ bst_choice_dialog_createv (BstChoice *first_choice,
break;
case BST_CHOICE_TYPE_ITEM:
any = gxk_dialog_action_multi (GXK_DIALOG (dialog), choice->name,
- button_choice_activate, choice->p_id,
+ (void*) button_choice_activate, choice->p_id,
choice->icon_stock_id,
- (choice_flags & BST_CHOICE_FLAG_DEFAULT) ? GXK_DIALOG_MULTI_DEFAULT : 0);
+ (choice_flags & BST_CHOICE_FLAG_DEFAULT) ? GXK_DIALOG_MULTI_DEFAULT : GxkDialogMultiFlags (0));
if (choice_flags & BST_CHOICE_FLAG_INSENSITIVE)
gtk_widget_set_sensitive (any, FALSE);
break;
@@ -337,7 +335,7 @@ bst_choice_selectable (GtkWidget *widget)
for (list = children; list; list = list->next)
{
- GtkBin *bin = list->data;
+ GtkBin *bin = (GtkBin*) list->data;
if (GTK_WIDGET_IS_SENSITIVE (bin) && GTK_WIDGET_VISIBLE (bin) && bin->child)
{
@@ -353,7 +351,7 @@ bst_choice_selectable (GtkWidget *widget)
for (list = children; list; list = list->next)
{
- GtkBin *bin = list->data;
+ GtkBin *bin = (GtkBin*) list->data;
if (GTK_IS_BUTTON (bin) && GTK_WIDGET_IS_SENSITIVE (bin) && GTK_WIDGET_VISIBLE (bin))
{
diff --git a/beast-gtk/bstmenus.h b/beast-gtk/bstmenus.h
index 139c2ec..1f3fce8 100644
--- a/beast-gtk/bstmenus.h
+++ b/beast-gtk/bstmenus.h
@@ -46,24 +46,24 @@ void bst_choice_destroy (GtkWidget *choice);
/* --- BstChoice shortcuts --- */
#define BST_CHOICE_TITLE(name) (bst_choice_alloc (BST_CHOICE_TYPE_TITLE, \
- (name), 0, BST_STOCK_NONE, 0))
+ (name), NULL, BST_STOCK_NONE, 0))
#define BST_CHOICE(id, name, bst_icon) (bst_choice_alloc (BST_CHOICE_TYPE_ITEM, \
- (name), (gpointer) (id), \
+ (name), (void*) (size_t) (id), \
BST_STOCK_ ## bst_icon, 0))
#define BST_CHOICE_D(id, name, bst_icon) (bst_choice_alloc (BST_CHOICE_TYPE_ITEM | \
BST_CHOICE_FLAG_DEFAULT, \
- (name), (gpointer) (id), \
+ (name), (void*) (size_t) (id), \
BST_STOCK_ ## bst_icon, 0))
#define BST_CHOICE_S(id, name, icon, s) (bst_choice_alloc (BST_CHOICE_TYPE_ITEM | \
- ((s) ? 0 : BST_CHOICE_FLAG_INSENSITIVE), \
- (name), (gpointer) (id), \
+ ((s) ? (BstChoiceFlags) 0 : BST_CHOICE_FLAG_INSENSITIVE), \
+ (name), (void*) (size_t) (id), \
BST_STOCK_ ## icon, 0))
#define BST_CHOICE_SUBMENU(nam,menu,icn) (bst_choice_alloc (BST_CHOICE_TYPE_SUBMENU, \
(nam), (menu), BST_STOCK_ ## icn, 0))
#define BST_CHOICE_TEXT(name) (bst_choice_alloc (BST_CHOICE_TYPE_TEXT, \
- (name), 0, BST_STOCK_NONE, 0))
+ (name), NULL, BST_STOCK_NONE, 0))
#define BST_CHOICE_SEPERATOR (bst_choice_alloc (BST_CHOICE_TYPE_SEPARATOR, \
- NULL, 0, BST_STOCK_NONE, 0))
+ NULL, NULL, BST_STOCK_NONE, 0))
#define BST_CHOICE_END (NULL)
@@ -88,4 +88,13 @@ BstChoice* bst_choice_alloc (BstChoiceFlags type,
G_END_DECLS
+// == Flags Enumeration Operators in C++ ==
+#ifdef __cplusplus
+inline BstChoiceFlags operator& (BstChoiceFlags s1, BstChoiceFlags s2) { return BstChoiceFlags (s1 & (long long unsigned) s2); }
+inline BstChoiceFlags& operator&= (BstChoiceFlags &s1, BstChoiceFlags s2) { s1 = s1 & s2; return s1; }
+inline BstChoiceFlags operator| (BstChoiceFlags s1, BstChoiceFlags s2) { return BstChoiceFlags (s1 | (long long unsigned) s2); }
+inline BstChoiceFlags& operator|= (BstChoiceFlags &s1, BstChoiceFlags s2) { s1 = s1 | s2; return s1; }
+inline BstChoiceFlags operator~ (BstChoiceFlags s1) { return BstChoiceFlags (~(long long unsigned) s1); }
+#endif // __cplusplus
+
#endif /* __BST_MENUS_H__ */
diff --git a/beast-gtk/bstmsgabsorb.c b/beast-gtk/bstmsgabsorb.cc
similarity index 93%
rename from beast-gtk/bstmsgabsorb.c
rename to beast-gtk/bstmsgabsorb.cc
index cb9a9ed..e0167b9 100644
--- a/beast-gtk/bstmsgabsorb.c
+++ b/beast-gtk/bstmsgabsorb.cc
@@ -164,7 +164,7 @@ msg_absorb_string_seq_fill_value (GtkWidget *self,
GValue *value,
GxkListWrapper *lwrapper)
{
- BstMsgAbsorbStringSeq *mass = g_object_get_data (self, "BstMsgAbsorbStringSeq");
+ BstMsgAbsorbStringSeq *mass = (BstMsgAbsorbStringSeq*) g_object_get_data ((GObject*) self, "BstMsgAbsorbStringSeq");
gint i = row;
if (i >= mass->n_strings || i < 0)
{
@@ -191,7 +191,7 @@ msg_absorb_string_toggled (GtkCellRendererToggle *cell,
gpointer data)
{
GxkRadget *self = data;
- BstMsgAbsorbStringSeq *mass = g_object_get_data (self, "BstMsgAbsorbStringSeq");
+ BstMsgAbsorbStringSeq *mass = (BstMsgAbsorbStringSeq*) g_object_get_data ((GObject*) self, "BstMsgAbsorbStringSeq");
gint i = gxk_tree_spath_index0 (strpath);
if (i >= 0 && i < mass->n_strings)
{
@@ -204,7 +204,7 @@ GtkWidget*
bst_msg_absorb_config_box (void)
{
GxkRadget *self = gxk_radget_create ("beast", "message-absorb-config-box", NULL);
- GtkTreeView *tview = gxk_radget_find (self, "message-tree-view");
+ GtkTreeView *tview = (GtkTreeView*) gxk_radget_find (self, "message-tree-view");
/* setup model */
GxkListWrapper *lwrapper = gxk_list_wrapper_new (N_MCOLS,
G_TYPE_BOOLEAN, /* MCOL_CHECK */
@@ -222,28 +222,28 @@ bst_msg_absorb_config_box (void)
GtkTreeViewColumn *col;
col = gxk_tree_view_add_toggle_column (tview, MCOL_CHECK, "", 0.5, "X",
_("Enable or disable message display of a specific message type"),
- msg_absorb_string_toggled, self, G_CONNECT_AFTER);
+ (void*) msg_absorb_string_toggled, self, G_CONNECT_AFTER);
col = gxk_tree_view_add_text_column (tview, MCOL_BLURB, "S", 0.0, _("Message Type"),
NULL, // _("The message type selection phrase displayed in message dialogs"),
- NULL, NULL, 0);
+ NULL, NULL, GConnectFlags (0));
col = gxk_tree_view_add_text_column (tview, MCOL_VERSION, "S", 0.0, _("Version"),
_("The last program version that displayed this message type"),
- NULL, NULL, 0);
+ NULL, NULL, GConnectFlags (0));
gtk_tree_view_set_expander_column (tview, col); /* where to put unused expander space */
- return self;
+ return (GtkWidget*) self;
}
void
bst_msg_absorb_config_box_set (GtkWidget *self,
BstMsgAbsorbStringSeq *mass)
{
- GtkTreeView *tview = gxk_radget_find (self, "message-tree-view");
+ GtkTreeView *tview = (GtkTreeView*) gxk_radget_find (self, "message-tree-view");
GtkTreeModel *model = gtk_tree_view_get_model (tview);
/* copy deep */
SfiSeq *seq = bst_msg_absorb_string_seq_to_seq (mass);
mass = bst_msg_absorb_string_seq_from_seq (seq);
sfi_seq_unref (seq);
- g_object_set_data_full (self, "BstMsgAbsorbStringSeq", mass, bst_key_binding_item_seq_free);
+ g_object_set_data_full ((GObject*) self, "BstMsgAbsorbStringSeq", mass, (GDestroyNotify) bst_key_binding_item_seq_free);
gxk_list_wrapper_notify_clear (GXK_LIST_WRAPPER (model));
gxk_list_wrapper_notify_append (GXK_LIST_WRAPPER (model), mass->n_strings);
}
@@ -251,7 +251,7 @@ bst_msg_absorb_config_box_set (GtkWidget *self,
BstMsgAbsorbStringSeq*
bst_msg_absorb_config_box_get (GtkWidget *self)
{
- BstMsgAbsorbStringSeq *mass = g_object_get_data (self, "BstMsgAbsorbStringSeq");
+ BstMsgAbsorbStringSeq *mass = (BstMsgAbsorbStringSeq*) g_object_get_data ((GObject*) self, "BstMsgAbsorbStringSeq");
return mass;
}
diff --git a/beast-gtk/bstparam-automation.c b/beast-gtk/bstparam-automation.cc
similarity index 78%
rename from beast-gtk/bstparam-automation.c
rename to beast-gtk/bstparam-automation.cc
index e9d3503..99ddd47 100644
--- a/beast-gtk/bstparam-automation.c
+++ b/beast-gtk/bstparam-automation.cc
@@ -22,22 +22,22 @@
static void
param_automation_dialog_cancel (GxkDialog *dialog)
{
- g_object_set_data (dialog, "beast-GxkParam", NULL);
+ g_object_set_data ((GObject*) dialog, "beast-GxkParam", NULL);
gxk_toplevel_delete (GTK_WIDGET (dialog));
}
static void
param_automation_dialog_ok (GxkDialog *dialog)
{
- GxkParam *param = g_object_get_data (dialog, "beast-GxkParam");
- g_object_set_data (dialog, "beast-GxkParam", NULL);
+ GxkParam *param = (GxkParam*) g_object_get_data ((GObject*) dialog, "beast-GxkParam");
+ g_object_set_data ((GObject*) dialog, "beast-GxkParam", NULL);
if (param)
{
SfiProxy proxy = bst_param_get_proxy (param);
- GxkParam *param_channel = g_object_get_data (dialog, "GxkParam-automation-channel");
- GxkParam *param_control = g_object_get_data (dialog, "GxkParam-automation-control");
+ GxkParam *param_channel = (GxkParam*) g_object_get_data ((GObject*) dialog, "GxkParam-automation-channel");
+ GxkParam *param_control = (GxkParam*) g_object_get_data ((GObject*) dialog, "GxkParam-automation-control");
gint midi_channel = sfi_value_get_int (¶m_channel->value);
- gint control_type = bse_midi_control_type_from_choice (sfi_value_get_choice (¶m_control->value));
+ BseMidiControlType control_type = bse_midi_control_type_from_choice (sfi_value_get_choice (¶m_control->value));
bse_source_set_automation (proxy, param->pspec->name, midi_channel, control_type);
}
gxk_toplevel_delete (GTK_WIDGET (dialog));
@@ -53,7 +53,7 @@ param_automation_popup_editor (GtkWidget *widget,
static GxkDialog *automation_dialog = NULL;
if (!automation_dialog)
{
- automation_dialog = g_object_new (GXK_TYPE_DIALOG, NULL);
+ automation_dialog = (GxkDialog*) g_object_new (GXK_TYPE_DIALOG, NULL);
/* configure dialog */
g_object_set (automation_dialog,
"flags", (GXK_DIALOG_HIDE_ON_DELETE |
@@ -62,34 +62,34 @@ param_automation_popup_editor (GtkWidget *widget,
GXK_DIALOG_MODAL),
NULL);
// gxk_dialog_set_sizes (automation_dialog, 550, 300, 600, 320);
- GtkBox *vbox = g_object_new (GTK_TYPE_VBOX, "visible", TRUE, "border-width", 5, NULL);
+ GtkBox *vbox = (GtkBox*) g_object_new (GTK_TYPE_VBOX, "visible", TRUE, "border-width", 5, NULL);
/* setup parameter: midi_channel */
GParamSpec *pspec = bst_procedure_ref_pspec ("BseSource+set-automation", "midi-channel");
GxkParam *dialog_param = bst_param_new_value (pspec, NULL, NULL);
g_param_spec_unref (pspec);
bst_param_create_gmask (dialog_param, NULL, GTK_WIDGET (vbox));
- g_object_set_data_full (automation_dialog, "GxkParam-automation-channel", dialog_param, gxk_param_destroy);
+ g_object_set_data_full ((GObject*) automation_dialog, "GxkParam-automation-channel", dialog_param, (GDestroyNotify) gxk_param_destroy);
/* setup parameter: control_type */
pspec = bst_procedure_ref_pspec ("BseSource+set-automation", "control-type");
dialog_param = bst_param_new_value (pspec, NULL, NULL);
g_param_spec_unref (pspec);
bst_param_create_gmask (dialog_param, NULL, GTK_WIDGET (vbox));
- g_object_set_data_full (automation_dialog, "GxkParam-automation-control", dialog_param, gxk_param_destroy);
+ g_object_set_data_full ((GObject*) automation_dialog, "GxkParam-automation-control", dialog_param, (GDestroyNotify) gxk_param_destroy);
/* dialog contents */
gxk_dialog_set_child (GXK_DIALOG (automation_dialog), GTK_WIDGET (vbox));
/* provide buttons */
- gxk_dialog_default_action_swapped (automation_dialog, BST_STOCK_OK, param_automation_dialog_ok, automation_dialog);
- gxk_dialog_action_swapped (automation_dialog, BST_STOCK_CANCEL, param_automation_dialog_cancel, automation_dialog);
+ gxk_dialog_default_action_swapped (automation_dialog, BST_STOCK_OK, (void*) param_automation_dialog_ok, automation_dialog);
+ gxk_dialog_action_swapped (automation_dialog, BST_STOCK_CANCEL, (void*) param_automation_dialog_cancel, automation_dialog);
}
- g_object_set_data (automation_dialog, "beast-GxkParam", param);
- GxkParam *param_channel = g_object_get_data (automation_dialog, "GxkParam-automation-channel");
- GxkParam *param_control = g_object_get_data (automation_dialog, "GxkParam-automation-control");
+ g_object_set_data ((GObject*) automation_dialog, "beast-GxkParam", param);
+ GxkParam *param_channel = (GxkParam*) g_object_get_data ((GObject*) automation_dialog, "GxkParam-automation-channel");
+ GxkParam *param_control = (GxkParam*) g_object_get_data ((GObject*) automation_dialog, "GxkParam-automation-control");
sfi_value_set_int (¶m_channel->value, bse_source_get_automation_channel (proxy, param->pspec->name));
sfi_value_set_choice (¶m_control->value, bse_midi_control_type_to_choice (bse_source_get_automation_control (proxy, param->pspec->name)));
gxk_param_apply_value (param_channel); /* update model, auto updates GUI */
gxk_param_apply_value (param_control); /* update model, auto updates GUI */
- g_object_set_data (widget, "GxkParam-automation-channel", param_channel);
- g_object_set_data (widget, "GxkParam-automation-control", param_control);
+ g_object_set_data ((GObject*) widget, "GxkParam-automation-channel", param_channel);
+ g_object_set_data ((GObject*) widget, "GxkParam-automation-control", param_control);
/* setup for proxy */
bst_window_sync_title_to_proxy (automation_dialog, proxy,
/* TRANSLATORS: this is a dialog title and %s is replaced by an object name */
@@ -130,23 +130,23 @@ param_automation_create (GxkParam *param,
guint variant)
{
/* create fake-entry dialog-popup button */
- GtkWidget *widget = g_object_new (GTK_TYPE_EVENT_BOX, NULL);
+ GtkWidget *widget = (GtkWidget*) g_object_new (GTK_TYPE_EVENT_BOX, NULL);
gxk_widget_modify_normal_bg_as_base (widget);
- GtkWidget *button = g_object_new (GTK_TYPE_BUTTON,
+ GtkWidget *button = (GtkWidget*) g_object_new (GTK_TYPE_BUTTON,
"can-focus", 0,
"parent", widget,
NULL);
gxk_widget_modify_normal_bg_as_base (button);
g_object_connect (button, "signal_after::size-request", param_automation_unrequest_focus_space, button, NULL);
- GtkWidget *label = g_object_new (GTK_TYPE_LABEL,
+ GtkWidget *label = (GtkWidget*) g_object_new (GTK_TYPE_LABEL,
"label", "88",
"xpad", 2,
"parent", button,
NULL);
gtk_widget_show_all (widget);
/* store handles */
- g_object_set_data (widget, "beast-GxkParam", param);
- g_object_set_data (widget, "beast-GxkParam-label", label);
+ g_object_set_data ((GObject*) widget, "beast-GxkParam", param);
+ g_object_set_data ((GObject*) widget, "beast-GxkParam-label", label);
/* connections */
g_object_connect (button, "signal::clicked", param_automation_popup_editor, param, NULL);
return widget;
@@ -174,21 +174,21 @@ param_automation_update (GxkParam *param,
{
const gchar *prefix = "";
gint midi_channel = bse_source_get_automation_channel (proxy, param->pspec->name);
- gint control_type = bse_source_get_automation_control (proxy, param->pspec->name);
+ BseMidiControlType control_type = bse_source_get_automation_control (proxy, param->pspec->name);
GParamSpec *control_pspec = bst_procedure_ref_pspec ("BseSource+set-automation", "control-type");
const SfiChoiceValue *cv = param_automation_find_choice_value (bse_midi_control_type_to_choice (control_type), control_pspec);
g_param_spec_unref (control_pspec);
if (control_type >= BSE_MIDI_CONTROL_CONTINUOUS_0 && control_type <= BSE_MIDI_CONTROL_CONTINUOUS_31)
{
prefix = "c";
- control_type = control_type - BSE_MIDI_CONTROL_CONTINUOUS_0;
+ control_type = BseMidiControlType (control_type - BSE_MIDI_CONTROL_CONTINUOUS_0);
}
else if (control_type >= BSE_MIDI_CONTROL_0 && control_type <= BSE_MIDI_CONTROL_127)
- control_type = control_type - BSE_MIDI_CONTROL_0;
+ control_type = BseMidiControlType (control_type - BSE_MIDI_CONTROL_0);
else if (control_type == BSE_MIDI_CONTROL_NONE)
- control_type = -1;
+ control_type = BseMidiControlType (-1);
else
- control_type += 10000; /* shouldn't happen */
+ control_type = BseMidiControlType (control_type + 10000); /* shouldn't happen */
if (control_type < 0) /* none */
{
content = g_strdup ("--");
@@ -219,7 +219,7 @@ param_automation_update (GxkParam *param,
}
}
}
- GtkWidget *label = g_object_get_data (widget, "beast-GxkParam-label");
+ GtkWidget *label = (GtkWidget*) g_object_get_data ((GObject*) widget, "beast-GxkParam-label");
g_object_set (label,
"label", content ? content : "--",
NULL);
diff --git a/beast-gtk/bstparam-choice.c b/beast-gtk/bstparam-choice.cc
similarity index 85%
rename from beast-gtk/bstparam-choice.c
rename to beast-gtk/bstparam-choice.cc
index bcaa169..71756f8 100644
--- a/beast-gtk/bstparam-choice.c
+++ b/beast-gtk/bstparam-choice.cc
@@ -32,7 +32,7 @@ param_choice_change_value (GtkWidget *widget,
item = GTK_OPTION_MENU (widget)->menu_item;
if (item)
{
- SfiChoiceValue *cv = g_object_get_qdata (G_OBJECT (item), quark_param_choice_values);
+ SfiChoiceValue *cv = (SfiChoiceValue*) g_object_get_qdata (G_OBJECT (item), quark_param_choice_values);
sfi_value_set_choice (¶m->value, cv->choice_ident);
}
gxk_param_apply_value (param);
@@ -60,18 +60,18 @@ param_choice_create (GxkParam *param,
guint i;
if (variant == CHOICE_PARAM_OPTION_MENU)
- widget = g_object_new (GTK_TYPE_OPTION_MENU,
- "visible", TRUE,
- NULL);
+ widget = (GtkWidget*) g_object_new (GTK_TYPE_OPTION_MENU,
+ "visible", TRUE,
+ NULL);
else
- widget = g_object_new (GXK_TYPE_MENU_BUTTON,
- "visible", TRUE,
- "mode", variant,
- "can-focus", variant == GXK_MENU_BUTTON_COMBO_MODE,
- NULL);
+ widget = (GtkWidget*) g_object_new (GXK_TYPE_MENU_BUTTON,
+ "visible", TRUE,
+ "mode", variant,
+ "can-focus", variant == GXK_MENU_BUTTON_COMBO_MODE,
+ NULL);
gxk_widget_set_tooltip (widget, tooltip);
- menu = g_object_new (GTK_TYPE_MENU, NULL);
+ menu = (GtkContainer*) g_object_new (GTK_TYPE_MENU, NULL);
for (i = 0; i < cvalues.n_values; i++)
{
GtkWidget *item = gtk_menu_item_new_with_label (cvalues.values[i].choice_label);
@@ -90,7 +90,7 @@ param_choice_create (GxkParam *param,
str = g_strdup_printf ("<BEAST-ParamChoice>/%s(%s::%llx)",
param->pspec->name,
proxy ? bse_item_get_type (proxy) : "0",
- sfi_pspec_get_choice_hash (param->pspec));
+ (long long unsigned) sfi_pspec_get_choice_hash (param->pspec));
gtk_menu_set_accel_path (GTK_MENU (menu), str);
g_free (str);
}
@@ -121,8 +121,8 @@ param_choice_update (GxkParam *param,
GList *list;
for (list = GTK_MENU_SHELL (menu)->children; list; list = list->next)
{
- GtkWidget *item = list->data;
- SfiChoiceValue *cv = g_object_get_qdata (G_OBJECT (item), quark_param_choice_values);
+ GtkWidget *item = (GtkWidget*) list->data;
+ SfiChoiceValue *cv = (SfiChoiceValue*) g_object_get_qdata (G_OBJECT (item), quark_param_choice_values);
if (sfi_choice_match (cv->choice_ident, string))
{
param_choice_item_activated (item, widget);
diff --git a/beast-gtk/bstparam-color-spinner.c b/beast-gtk/bstparam-color-spinner.cc
similarity index 97%
rename from beast-gtk/bstparam-color-spinner.c
rename to beast-gtk/bstparam-color-spinner.cc
index 8e5288b..4bfe2b3 100644
--- a/beast-gtk/bstparam-color-spinner.c
+++ b/beast-gtk/bstparam-color-spinner.cc
@@ -51,7 +51,7 @@ param_color_assign (GtkWidget *dialog,
GdkColor *color,
gpointer user_data)
{
- GtkSpinButton *spin_button = user_data;
+ GtkSpinButton *spin_button = (GtkSpinButton*) user_data;
GdkColor c = *color;
guint n = ((c.red >> 8) << 16) + ((c.green >> 8) << 8) + (c.blue >> 8);
gtk_adjustment_set_value (spin_button->adjustment, n);
@@ -79,7 +79,7 @@ param_color_spinner_create (GxkParam *param,
GtkAdjustment *adjustment = gxk_param_get_adjustment_with_stepping (param, 0x101010);
GtkWidget *widget = gtk_spin_button_new (adjustment, 0, 0);
GtkWidget *btn, *box;
- g_object_set_data (widget, "beast-GxkParam", param);
+ g_object_set_data ((GObject*) widget, "beast-GxkParam", param);
g_object_set (widget,
"visible", TRUE,
"activates_default", TRUE,
diff --git a/beast-gtk/bstparam-item-seq.c b/beast-gtk/bstparam-item-seq.cc
similarity index 86%
rename from beast-gtk/bstparam-item-seq.c
rename to beast-gtk/bstparam-item-seq.cc
index 4ae29c1..f149ccc 100644
--- a/beast-gtk/bstparam-item-seq.c
+++ b/beast-gtk/bstparam-item-seq.cc
@@ -23,7 +23,7 @@ param_item_seq_changed (gpointer data,
BseItemSeq *iseq,
BstItemSeqDialog *isdialog)
{
- GxkParam *param = data;
+ GxkParam *param = (GxkParam*) data;
SfiProxy proxy = bst_param_get_proxy (param);
if (proxy)
{
@@ -41,7 +41,7 @@ param_item_seq_popup_editor (GtkWidget *widget,
if (proxy)
{
BsePropertyCandidates *pc = bse_item_get_property_candidates (proxy, param->pspec->name);
- SfiSeq *seq = g_value_get_boxed (¶m->value);
+ SfiSeq *seq = (SfiSeq*) g_value_get_boxed (¶m->value);
BseItemSeq *iseq = bse_item_seq_from_seq (seq);
bst_item_seq_dialog_popup (widget, proxy,
pc->label, pc->tooltip, pc->items,
@@ -58,33 +58,33 @@ param_item_seq_create (GxkParam *param,
guint variant)
{
/* create entry-look-alike dialog-popup button with "..." indicator */
- GtkWidget *widget = g_object_new (GTK_TYPE_BUTTON,
+ GtkWidget *widget = (GtkWidget*) g_object_new (GTK_TYPE_BUTTON,
"can-focus", 1,
NULL);
gxk_widget_set_tooltip (widget, tooltip);
- GtkWidget *box = g_object_new (GTK_TYPE_HBOX,
+ GtkWidget *box = (GtkWidget*) g_object_new (GTK_TYPE_HBOX,
"parent", widget,
"spacing", 3,
NULL);
- GtkWidget *label = g_object_new (GTK_TYPE_LABEL,
+ GtkWidget *label = (GtkWidget*) g_object_new (GTK_TYPE_LABEL,
"label", _("..."),
NULL);
gtk_box_pack_end (GTK_BOX (box), label, FALSE, TRUE, 0);
- GtkWidget *frame = g_object_new (GTK_TYPE_FRAME,
+ GtkWidget *frame = (GtkWidget*) g_object_new (GTK_TYPE_FRAME,
"shadow-type", GTK_SHADOW_IN,
"border-width", 1,
"parent", box,
NULL);
gxk_widget_modify_normal_bg_as_base (frame);
- GtkWidget *ebox = g_object_new (GTK_TYPE_EVENT_BOX,
+ GtkWidget *ebox = (GtkWidget*) g_object_new (GTK_TYPE_EVENT_BOX,
"parent", frame,
NULL);
gxk_widget_modify_normal_bg_as_base (ebox);
- label = g_object_new (GXK_TYPE_SIMPLE_LABEL, "parent", ebox, "auto-cut", TRUE, "xpad", 2, NULL);
+ label = (GtkWidget*) g_object_new (GXK_TYPE_SIMPLE_LABEL, "parent", ebox, "auto-cut", TRUE, "xpad", 2, NULL);
gxk_widget_modify_normal_bg_as_base (label);
/* store handles */
- g_object_set_data (widget, "beast-GxkParam", param);
- g_object_set_data (widget, "beast-GxkParam-label", label);
+ g_object_set_data ((GObject*) widget, "beast-GxkParam", param);
+ g_object_set_data ((GObject*) widget, "beast-GxkParam-label", label);
/* connections */
g_object_connect (widget, "signal::clicked", param_item_seq_popup_editor, param, NULL);
gtk_widget_show_all (widget);
@@ -101,7 +101,7 @@ param_item_seq_update (GxkParam *param,
if (proxy)
{
BsePropertyCandidates *pc = bse_item_get_property_candidates (proxy, param->pspec->name);
- SfiSeq *seq = g_value_get_boxed (¶m->value);
+ SfiSeq *seq = (SfiSeq*) g_value_get_boxed (¶m->value);
BseItemSeq *iseq = seq ? bse_item_seq_from_seq (seq) : NULL;
if (iseq)
{
@@ -134,7 +134,7 @@ param_item_seq_update (GxkParam *param,
bse_item_seq_free (iseq);
}
}
- GtkWidget *label = g_object_get_data (widget, "beast-GxkParam-label");
+ GtkWidget *label = (GtkWidget*) g_object_get_data ((GObject*) widget, "beast-GxkParam-label");
g_object_set (label,
"label", content ? content : "--",
NULL);
diff --git a/beast-gtk/bstparam-note-sequence.c b/beast-gtk/bstparam-note-sequence.cc
similarity index 96%
rename from beast-gtk/bstparam-note-sequence.c
rename to beast-gtk/bstparam-note-sequence.cc
index 78dfd4c..95dbf7a 100644
--- a/beast-gtk/bstparam-note-sequence.c
+++ b/beast-gtk/bstparam-note-sequence.cc
@@ -33,7 +33,7 @@ param_note_sequence_create (GxkParam *param,
const gchar *tooltip,
guint variant)
{
- GtkWidget *widget = g_object_new (BST_TYPE_SEQUENCE, NULL);
+ GtkWidget *widget = (GtkWidget*) g_object_new (BST_TYPE_SEQUENCE, NULL);
g_object_connect (widget,
"signal::seq-changed", param_note_sequence_changed, param,
NULL);
diff --git a/beast-gtk/bstparam-note-spinner.c b/beast-gtk/bstparam-note-spinner.cc
similarity index 100%
rename from beast-gtk/bstparam-note-spinner.c
rename to beast-gtk/bstparam-note-spinner.cc
diff --git a/beast-gtk/bstparam-proxy.c b/beast-gtk/bstparam-proxy.cc
similarity index 91%
rename from beast-gtk/bstparam-proxy.c
rename to beast-gtk/bstparam-proxy.cc
index acdbf72..c5d0abb 100644
--- a/beast-gtk/bstparam-proxy.c
+++ b/beast-gtk/bstparam-proxy.cc
@@ -26,7 +26,7 @@ typedef struct {
static void
param_proxy_free_population (gpointer p)
{
- ParamProxyPopulation *pop = p;
+ ParamProxyPopulation *pop = (ParamProxyPopulation*) p;
g_strfreev (pop->paths);
g_free (pop->prefix);
bse_item_seq_free (pop->iseq);
@@ -109,8 +109,8 @@ param_proxy_changed (GtkWidget *entry,
{
if (!param->updating)
{
- GtkWidget *chunter = bst_clue_hunter_from_entry (entry);
- ParamProxyPopulation *pop = g_object_get_data (G_OBJECT (chunter), "pop");
+ GtkWidget *chunter = (GtkWidget*) bst_clue_hunter_from_entry (entry);
+ ParamProxyPopulation *pop = (ParamProxyPopulation*) g_object_get_data (G_OBJECT (chunter), "pop");
gchar *string = g_strdup_stripped (gtk_entry_get_text (GTK_ENTRY (entry)));
SfiProxy item = 0;
if (pop)
@@ -181,7 +181,7 @@ bst_item_seq_list_match (GSList *item_seq_slist,
l = strlen (text);
for (slist = item_seq_slist; slist; slist = slist->next)
{
- BseItemSeq *iseq = slist->data;
+ BseItemSeq *iseq = (BseItemSeq*) slist->data;
for (i = 0; i < iseq->n_items; i++)
{
const gchar *path = bse_item_get_uname_path (iseq->items[i]);
@@ -206,12 +206,12 @@ param_proxy_create (GxkParam *param,
guint variant)
{
GtkWidget *box = gtk_hbox_new (FALSE, 0);
- GtkWidget *widget = g_object_new (GTK_TYPE_ENTRY,
+ GtkWidget *widget = (GtkWidget*) g_object_new (GTK_TYPE_ENTRY,
"activates_default", TRUE,
"parent", box,
"width_chars", 0,
NULL);
- GtkWidget *chunter = g_object_new (BST_TYPE_CLUE_HUNTER,
+ GtkWidget *chunter = (GtkWidget*) g_object_new (BST_TYPE_CLUE_HUNTER,
"keep_history", FALSE,
"entry", widget,
"user_data", param,
@@ -244,16 +244,16 @@ param_proxy_update (GxkParam *param,
SfiProxy item = sfi_value_get_proxy (¶m->value);
const gchar *cstring = item ? bse_item_get_uname_path (item) : NULL;
GtkWidget *entry = ((GtkBoxChild*) GTK_BOX (box)->children->data)->widget;
- GtkWidget *chunter = bst_clue_hunter_from_entry (entry);
+ GtkWidget *chunter = (GtkWidget*) bst_clue_hunter_from_entry (entry);
if (cstring && chunter)
{
- ParamProxyPopulation *pop = g_object_get_data (G_OBJECT (chunter), "pop");
+ ParamProxyPopulation *pop = (ParamProxyPopulation*) g_object_get_data (G_OBJECT (chunter), "pop");
if (!pop)
{
/* try populating now */
param_proxy_populate (chunter, param);
- pop = g_object_get_data (G_OBJECT (chunter), "pop");
+ pop = (ParamProxyPopulation*) g_object_get_data (G_OBJECT (chunter), "pop");
}
if (pop)
{
@@ -267,7 +267,7 @@ param_proxy_update (GxkParam *param,
{
/* prefix became invalid */
param_proxy_populate (chunter, param);
- pop = g_object_get_data (G_OBJECT (chunter), "pop");
+ pop = (ParamProxyPopulation*) g_object_get_data (G_OBJECT (chunter), "pop");
if (pop && pop->prefix)
{
l = strlen (pop->prefix);
diff --git a/beast-gtk/bstparam-scale.c b/beast-gtk/bstparam-scale.cc
similarity index 96%
rename from beast-gtk/bstparam-scale.c
rename to beast-gtk/bstparam-scale.cc
index 1cb4360..07ee1e0 100644
--- a/beast-gtk/bstparam-scale.c
+++ b/beast-gtk/bstparam-scale.cc
@@ -44,11 +44,11 @@ param_scale_create (GxkParam *param,
switch (svariant)
{
case PARAM_SCALE_DIAL:
- widget = g_object_new (BST_TYPE_DIAL, NULL);
+ widget = (GtkWidget*) g_object_new (BST_TYPE_DIAL, NULL);
bst_dial_set_adjustment (BST_DIAL (widget), adjustment);
break;
case PARAM_SCALE_KNOB:
- widget = g_object_new (BST_TYPE_KNOB, NULL);
+ widget = (GtkWidget*) g_object_new (BST_TYPE_KNOB, NULL);
bst_knob_set_adjustment (BST_KNOB (widget), adjustment);
break;
}
diff --git a/beast-gtk/bstparam-searchpath.c b/beast-gtk/bstparam-searchpath.cc
similarity index 93%
rename from beast-gtk/bstparam-searchpath.c
rename to beast-gtk/bstparam-searchpath.cc
index 6cfce82..84c1c72 100644
--- a/beast-gtk/bstparam-searchpath.c
+++ b/beast-gtk/bstparam-searchpath.cc
@@ -22,7 +22,7 @@
static void
param_searchpath_change_value (GtkWidget *entry)
{
- GxkParam *param = g_object_get_data (entry, "beast-GxkParam");
+ GxkParam *param = (GxkParam*) g_object_get_data ((GObject*) entry, "beast-GxkParam");
if (!param->updating)
{
const gchar *string = gtk_entry_get_text (GTK_ENTRY (entry));
@@ -36,7 +36,7 @@ param_searchpath_assign (GtkWidget *dialog,
gchar **strings,
gpointer user_data)
{
- GtkWidget *widget = user_data;
+ GtkWidget *widget = (GtkWidget*) user_data;
gchar *paths = g_strjoinv (G_SEARCHPATH_SEPARATOR_S, strings);
gtk_entry_set_text (GTK_ENTRY (widget), paths);
g_free (paths);
@@ -67,8 +67,8 @@ param_searchpath_add (GtkWidget *dialog,
const gchar *file,
gpointer user_data)
{
- GtkWidget *widget = user_data;
- gchar *path = gtk_entry_get_text (GTK_ENTRY (widget));
+ GtkWidget *widget = (GtkWidget*) user_data;
+ const char *path = gtk_entry_get_text (GTK_ENTRY (widget));
gchar *str = g_path_concat (path, file, NULL);
gtk_entry_set_text (GTK_ENTRY (widget), str);
g_free (str);
@@ -91,7 +91,7 @@ param_searchpath_replace (GtkWidget *dialog,
const gchar *file,
gpointer user_data)
{
- GtkWidget *widget = user_data;
+ GtkWidget *widget = (GtkWidget*) user_data;
gtk_entry_set_text (GTK_ENTRY (widget), file);
param_searchpath_change_value (widget);
}
@@ -114,7 +114,7 @@ param_searchpath_create (GxkParam *param,
{
GtkWidget *widget = gxk_param_create_editor (param, "entry");
GtkWidget *box = gtk_hbox_new (FALSE, 0);
- g_object_set_data (widget, "beast-GxkParam", param);
+ g_object_set_data ((GObject*) widget, "beast-GxkParam", param);
gtk_box_pack_start (GTK_BOX (box), widget, TRUE, TRUE, 0);
if (g_param_spec_check_option (param->pspec, "searchpath"))
{
diff --git a/beast-gtk/bstparam-time.c b/beast-gtk/bstparam-time.cc
similarity index 84%
rename from beast-gtk/bstparam-time.c
rename to beast-gtk/bstparam-time.cc
index 0824253..6932940 100644
--- a/beast-gtk/bstparam-time.c
+++ b/beast-gtk/bstparam-time.cc
@@ -30,11 +30,11 @@ param_time_create (GxkParam *param,
const gchar *tooltip,
guint variant)
{
- GtkWidget *widget = g_object_new (GTK_TYPE_ENTRY,
- "visible", TRUE,
- "activates_default", TRUE,
- "width_chars", 0,
- NULL);
+ GtkWidget *widget = (GtkWidget*) g_object_new (GTK_TYPE_ENTRY,
+ "visible", TRUE,
+ "activates_default", TRUE,
+ "width_chars", 0,
+ NULL);
gxk_widget_add_font_requisition (widget, 5, 14);
gxk_param_entry_connect_handlers (param, widget, param_time_changed);
gxk_widget_set_tooltip (widget, tooltip);
diff --git a/beast-gtk/bstparam.c b/beast-gtk/bstparam.cc
similarity index 87%
rename from beast-gtk/bstparam.c
rename to beast-gtk/bstparam.cc
index 851b992..41f5fed 100644
--- a/beast-gtk/bstparam.c
+++ b/beast-gtk/bstparam.cc
@@ -40,13 +40,13 @@ param_get_gmask_container (GtkWidget *parent,
GtkWidget *any;
container = bst_gmask_container_create (quark_group ? 5 : 0, FALSE);
if (quark_group)
- any = g_object_new (GTK_TYPE_FRAME,
- "visible", TRUE,
- "child", container,
- "label-widget", g_object_new (GXK_TYPE_SIMPLE_LABEL,
- "label", g_quark_to_string (quark_group),
- NULL),
- NULL);
+ any = (GtkWidget*) g_object_new (GTK_TYPE_FRAME,
+ "visible", TRUE,
+ "child", container,
+ "label-widget", g_object_new (GXK_TYPE_SIMPLE_LABEL,
+ "label", g_quark_to_string (quark_group),
+ NULL),
+ NULL);
else
any = container;
if (GTK_IS_BOX (parent))
@@ -102,7 +102,7 @@ bst_param_create_gmask_intern (GxkParam *param,
action = gxk_param_create_editor (param, editor_name);
- xframe = g_object_new (BST_TYPE_XFRAME, "cover", action, NULL);
+ xframe = (GtkWidget*) g_object_new (BST_TYPE_XFRAME, "cover", action, NULL);
g_object_connect (xframe,
"swapped_signal::button_check", bst_param_xframe_check_button, param,
NULL);
@@ -118,12 +118,12 @@ bst_param_create_gmask_intern (GxkParam *param,
}
else
{
- prompt = g_object_new (GTK_TYPE_LABEL,
- "visible", TRUE,
- "label", g_param_spec_get_nick (param->pspec),
- "xalign", 0.0,
- "parent", xframe,
- NULL);
+ prompt = (GtkWidget*) g_object_new (GTK_TYPE_LABEL,
+ "visible", TRUE,
+ "label", g_param_spec_get_nick (param->pspec),
+ "xalign", 0.0,
+ "parent", xframe,
+ NULL);
gxk_param_add_object (param, GTK_OBJECT (prompt));
}
@@ -135,7 +135,7 @@ bst_param_create_gmask_intern (GxkParam *param,
GtkWidget *automation = gxk_param_create_editor (param, "automation");
if (prompt)
{
- GtkBox *hbox = g_object_new (GTK_TYPE_HBOX, "visible", TRUE, NULL);
+ GtkBox *hbox = (GtkBox*) g_object_new (GTK_TYPE_HBOX, "visible", TRUE, NULL);
gtk_box_pack_start (hbox, gtk_widget_get_toplevel (prompt), FALSE, TRUE, 0);
gtk_box_pack_end (hbox, automation, FALSE, TRUE, 0);
}
@@ -249,7 +249,7 @@ static void
proxy_binding_weakref (gpointer data,
SfiProxy junk)
{
- GxkParam *param = data;
+ GxkParam *param = (GxkParam*) data;
param->bdata[0].v_long = 0;
param->bdata[1].v_long = 0; /* already disconnected */
}
@@ -296,13 +296,14 @@ proxy_binding_check_writable (GxkParam *param)
}
static GxkParamBinding proxy_binding = {
- .n_data_fields = 2,
- .set_value = proxy_binding_set_value,
- .get_value = proxy_binding_get_value,
- .destroy = proxy_binding_destroy,
- .check_writable = proxy_binding_check_writable,
- .start_grouping = proxy_binding_start_grouping,
- .stop_grouping = proxy_binding_stop_grouping,
+ 2, // n_data_fields
+ NULL, // setup
+ proxy_binding_set_value,
+ proxy_binding_get_value,
+ proxy_binding_destroy,
+ proxy_binding_check_writable,
+ proxy_binding_start_grouping,
+ proxy_binding_stop_grouping,
};
GxkParam*
@@ -327,7 +328,7 @@ bst_param_set_proxy (GxkParam *param,
if (proxy)
{
gchar *sig = g_strconcat ("property-notify::", param->pspec->name, NULL);
- param->bdata[1].v_long = sfi_glue_signal_connect_swapped (proxy, sig, gxk_param_update, param);
+ param->bdata[1].v_long = sfi_glue_signal_connect_swapped (proxy, sig, (void*) gxk_param_update, param);
g_free (sig);
sfi_glue_proxy_weak_ref (proxy, proxy_binding_weakref, param);
}
@@ -349,14 +350,14 @@ static void
record_binding_set_value (GxkParam *param,
const GValue *value)
{
- sfi_rec_set (param->bdata[0].v_pointer, param->pspec->name, value);
+ sfi_rec_set ((SfiRec*) param->bdata[0].v_pointer, param->pspec->name, value);
}
static void
record_binding_get_value (GxkParam *param,
GValue *value)
{
- const GValue *cvalue = sfi_rec_get (param->bdata[0].v_pointer, param->pspec->name);
+ const GValue *cvalue = sfi_rec_get ((SfiRec*) param->bdata[0].v_pointer, param->pspec->name);
if (cvalue)
g_value_transform (cvalue, value);
else
@@ -366,7 +367,7 @@ record_binding_get_value (GxkParam *param,
static void
record_binding_destroy (GxkParam *param)
{
- sfi_rec_unref (param->bdata[0].v_pointer);
+ sfi_rec_unref ((SfiRec*) param->bdata[0].v_pointer);
param->bdata[0].v_pointer = NULL;
}
@@ -421,16 +422,16 @@ bst_param_xframe_check_button (GxkParam *param,
/* --- param editor registration --- */
-#include "bstparam-choice.c"
-#include "bstparam-color-spinner.c"
-#include "bstparam-note-sequence.c"
-#include "bstparam-note-spinner.c"
-#include "bstparam-proxy.c"
-#include "bstparam-item-seq.c"
-#include "bstparam-scale.c"
-#include "bstparam-searchpath.c"
-#include "bstparam-time.c"
-#include "bstparam-automation.c"
+#include "bstparam-choice.cc"
+#include "bstparam-color-spinner.cc"
+#include "bstparam-note-sequence.cc"
+#include "bstparam-note-spinner.cc"
+#include "bstparam-proxy.cc"
+#include "bstparam-item-seq.cc"
+#include "bstparam-scale.cc"
+#include "bstparam-searchpath.cc"
+#include "bstparam-time.cc"
+#include "bstparam-automation.cc"
void
_bst_init_params (void)
{
diff --git a/beast-gtk/bstparamview.c b/beast-gtk/bstparamview.cc
similarity index 89%
rename from beast-gtk/bstparamview.c
rename to beast-gtk/bstparamview.cc
index e30ca3a..fc20684 100644
--- a/beast-gtk/bstparamview.c
+++ b/beast-gtk/bstparamview.cc
@@ -32,12 +32,12 @@ static BstParamViewClass *bst_param_view_class = NULL;
G_DEFINE_TYPE (BstParamView, bst_param_view, GTK_TYPE_VBOX);
static void
-bst_param_view_class_init (BstParamViewClass *class)
+bst_param_view_class_init (BstParamViewClass *klass)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (class);
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
- bst_param_view_class = class;
+ bst_param_view_class = klass;
gobject_class->finalize = bst_param_view_finalize;
@@ -62,7 +62,7 @@ bst_param_view_destroy_contents (BstParamView *self)
{
gtk_container_foreach (GTK_CONTAINER (self), (GtkCallback) gtk_widget_destroy, NULL);
while (self->params)
- gxk_param_destroy (g_slist_pop_head (&self->params));
+ gxk_param_destroy ((GxkParam*) g_slist_pop_head (&self->params));
}
static void
@@ -142,7 +142,7 @@ bst_param_view_set_item (BstParamView *self,
self->item = 0;
for (slist = self->params; slist; slist = slist->next)
- bst_param_set_proxy (slist->data, 0);
+ bst_param_set_proxy ((GxkParam*) slist->data, 0);
}
self->item = item;
@@ -188,7 +188,7 @@ bst_param_view_apply_defaults (BstParamView *self)
GSList *slist;
bse_item_group_undo (self->item, "Reset to defaults");
for (slist = self->params; slist; slist = slist->next)
- gxk_param_apply_default (slist->data);
+ gxk_param_apply_default ((GxkParam*) slist->data);
bse_item_ungroup_undo (self->item);
}
}
@@ -226,13 +226,13 @@ bst_param_view_rebuild (BstParamView *self)
if (param_group)
{
if (!gcontainer)
- gcontainer = g_object_new (GTK_TYPE_VBOX, NULL);
+ gcontainer = (GtkWidget*) g_object_new (GTK_TYPE_VBOX, NULL);
bst_param_create_gmask (param, NULL, gcontainer);
}
else
{
if (!ncontainer)
- ncontainer = g_object_new (GTK_TYPE_VBOX, NULL);
+ ncontainer = (GtkWidget*) g_object_new (GTK_TYPE_VBOX, NULL);
bst_param_create_gmask (param, NULL, ncontainer);
}
self->params = g_slist_prepend (self->params, param);
@@ -254,9 +254,9 @@ bst_param_view_rebuild (BstParamView *self)
if (gcontainer)
{
if (ncontainer)
- gtk_box_pack_start (pbox, g_object_new (GTK_TYPE_HSEPARATOR,
- "visible", TRUE,
- NULL),
+ gtk_box_pack_start (pbox, (GtkWidget*) g_object_new (GTK_TYPE_HSEPARATOR,
+ "visible", TRUE,
+ NULL),
FALSE, FALSE, 0);
g_object_set (gcontainer,
"visible", TRUE,
@@ -269,5 +269,5 @@ bst_param_view_rebuild (BstParamView *self)
/* refresh parameter fields */
for (slist = self->params; slist; slist = slist->next)
- gxk_param_update (slist->data);
+ gxk_param_update ((GxkParam*) slist->data);
}
diff --git a/beast-gtk/bstpartdialog.c b/beast-gtk/bstpartdialog.cc
similarity index 94%
rename from beast-gtk/bstpartdialog.c
rename to beast-gtk/bstpartdialog.cc
index 20cf4ed..1dab3fc 100644
--- a/beast-gtk/bstpartdialog.c
+++ b/beast-gtk/bstpartdialog.cc
@@ -77,9 +77,9 @@ static const GxkStockAction piano_clear_undo[] = {
G_DEFINE_TYPE (BstPartDialog, bst_part_dialog, GXK_TYPE_DIALOG);
static void
-bst_part_dialog_class_init (BstPartDialogClass *class)
+bst_part_dialog_class_init (BstPartDialogClass *klass)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = bst_part_dialog_finalize;
}
@@ -118,7 +118,6 @@ eparam_changed (gpointer data,
static void
bst_part_dialog_init (BstPartDialog *self)
{
- GtkWidget *eb, *box;
GtkRange *srange;
BseCategorySeq *cseq;
GxkActionList *al1;
@@ -136,7 +135,7 @@ bst_part_dialog_init (BstPartDialog *self)
/* radget-complete GUI */
radget = gxk_radget_create ("beast", "piano-roll-box", NULL);
- gtk_container_add (GTK_CONTAINER (GXK_DIALOG (self)->vbox), radget);
+ gtk_container_add (GTK_CONTAINER (GXK_DIALOG (self)->vbox), (GtkWidget*) radget);
/* publish actions */
gxk_widget_publish_actions (self, "piano-edit-actions",
@@ -155,13 +154,13 @@ bst_part_dialog_init (BstPartDialog *self)
gxk_action_list_sort (al1);
gxk_widget_publish_action_list (self, "part-scripts", al1);
- BstGrowBar *grow_bar = gxk_radget_find (radget, "piano-roll-hgrow-bar");
+ BstGrowBar *grow_bar = (BstGrowBar*) gxk_radget_find (radget, "piano-roll-hgrow-bar");
/* piano roll */
- self->proll = gxk_radget_find (radget, "piano-roll");
+ self->proll = (BstPianoRoll*) gxk_radget_find (radget, "piano-roll");
gxk_nullify_in_object (self, &self->proll);
g_signal_connect (self->proll, "canvas-clicked", G_CALLBACK (piano_canvas_clicked), self);
- srange = gxk_radget_find (radget, "piano-roll-vscrollbar");
+ srange = (GtkRange*) gxk_radget_find (radget, "piano-roll-vscrollbar");
gxk_scroll_canvas_set_vadjustment (GXK_SCROLL_CANVAS (self->proll), gtk_range_get_adjustment (srange));
adj = bst_grow_bar_get_adjustment (grow_bar);
gxk_scroll_canvas_set_hadjustment (GXK_SCROLL_CANVAS (self->proll), adj);
@@ -172,21 +171,21 @@ bst_part_dialog_init (BstPartDialog *self)
gxk_widget_publish_action_list (self, "pctrl-quant-tools", bst_piano_roll_controller_quant_actions (self->pctrl));
/* event roll */
- self->eroll = gxk_radget_find (radget, "event-roll");
+ self->eroll = (BstEventRoll*) gxk_radget_find (radget, "event-roll");
gxk_nullify_in_object (self, &self->eroll);
g_signal_connect (self->eroll, "canvas-clicked", G_CALLBACK (event_canvas_clicked), self);
self->ectrl = bst_event_roll_controller_new (self->eroll, self->pctrl->quant_rtools, self->pctrl->canvas_rtools);
adj = bst_grow_bar_get_adjustment (grow_bar);
gxk_scroll_canvas_set_hadjustment (GXK_SCROLL_CANVAS (self->eroll), adj);
- bst_event_roll_set_vpanel_width_hook (self->eroll, (gpointer) bst_piano_roll_get_vpanel_width, self->proll);
+ bst_event_roll_set_vpanel_width_hook (self->eroll, (int (*) (void*)) bst_piano_roll_get_vpanel_width, self->proll);
gxk_widget_publish_action_list (self, "ectrl-select-actions", bst_event_roll_controller_select_actions (self->ectrl));
- grow_bar = gxk_radget_find (radget, "pattern-view-vgrow-bar");
+ grow_bar = (BstGrowBar*) gxk_radget_find (radget, "pattern-view-vgrow-bar");
/* pattern view */
- self->pview = gxk_radget_find (radget, "pattern-view");
+ self->pview = (BstPatternView*) gxk_radget_find (radget, "pattern-view");
gxk_nullify_in_object (self, &self->pview);
- srange = gxk_radget_find (radget, "pattern-view-hscrollbar");
+ srange = (GtkRange*) gxk_radget_find (radget, "pattern-view-hscrollbar");
gxk_scroll_canvas_set_hadjustment (GXK_SCROLL_CANVAS (self->pview), gtk_range_get_adjustment (srange));
adj = bst_grow_bar_get_adjustment (grow_bar);
gxk_scroll_canvas_set_vadjustment (GXK_SCROLL_CANVAS (self->pview), adj);
@@ -195,7 +194,7 @@ bst_part_dialog_init (BstPartDialog *self)
/* pattern view controls */
g_signal_connect_swapped (gxk_radget_find (radget, "configure-button"), "clicked",
G_CALLBACK (bst_pattern_column_layouter_popup), self->pview);
- box = gxk_radget_find (radget, "pattern-control-box");
+ // box = (GtkWidget*) gxk_radget_find (radget, "pattern-control-box");
gxk_radget_add (radget, "pattern-control-box", gxk_param_create_editor (self->pvctrl->vraster, "name"));
gxk_radget_add (radget, "pattern-control-box", gxk_param_create_editor (self->pvctrl->vraster, "combo-button"));
gxk_radget_add (radget, "pattern-control-box", gxk_vseparator_space_new (TRUE));
@@ -217,7 +216,6 @@ bst_part_dialog_init (BstPartDialog *self)
g_object_new (GTK_TYPE_LABEL, "visible", TRUE, "label", "C", "parent", self->eroll, NULL);
/* event roll control type */
- eb = g_object_new (GTK_TYPE_VBOX, "spacing", SCROLLBAR_SPACING, NULL);
pspec = bst_procedure_ref_pspec ("BsePart+change-control", "control-type");
if (pspec)
{
@@ -320,7 +318,7 @@ piano_canvas_clicked (BstPianoRoll *proll,
BstPartDialog *self)
{
if (button == 3 && event)
- gxk_menu_popup (gxk_radget_find (self, "piano-popup"),
+ gxk_menu_popup ((GtkMenu*) gxk_radget_find (self, "piano-popup"),
event->button.x_root, event->button.y_root,
event->button.button, event->button.time);
}
@@ -334,7 +332,7 @@ event_canvas_clicked (BstEventRoll *eroll,
BstPartDialog *self)
{
if (button == 3 && event)
- gxk_menu_popup (gxk_radget_find (self, "event-popup"),
+ gxk_menu_popup ((GtkMenu*) gxk_radget_find (self, "event-popup"),
event->button.x_root, event->button.y_root,
event->button.button, event->button.time);
}
diff --git a/beast-gtk/bstpartview.c b/beast-gtk/bstpartview.cc
similarity index 92%
rename from beast-gtk/bstpartview.c
rename to beast-gtk/bstpartview.cc
index 235101c..b763f4f 100644
--- a/beast-gtk/bstpartview.c
+++ b/beast-gtk/bstpartview.cc
@@ -46,9 +46,9 @@ static const GxkStockAction part_view_actions[] = {
G_DEFINE_TYPE (BstPartView, bst_part_view, BST_TYPE_ITEM_VIEW);
static void
-bst_part_view_class_init (BstPartViewClass *class)
+bst_part_view_class_init (BstPartViewClass *klass)
{
- BstItemViewClass *item_view_class = BST_ITEM_VIEW_CLASS (class);
+ BstItemViewClass *item_view_class = BST_ITEM_VIEW_CLASS (klass);
item_view_class->item_type = "BsePart";
}
@@ -60,14 +60,14 @@ bst_part_view_init (BstPartView *self)
/* complete GUI */
GxkRadget *radget = gxk_radget_complete (GTK_WIDGET (self), "beast", "part-view", NULL);
/* setup tree view */
- GtkTreeView *tview = gxk_radget_find (radget, "tree-view");
+ GtkTreeView *tview = (GtkTreeView*) gxk_radget_find (radget, "tree-view");
bst_item_view_complete_tree (iview, tview);
/* create tool actions */
gxk_widget_publish_actions (self, "part-view-actions",
G_N_ELEMENTS (part_view_actions), part_view_actions,
NULL, part_view_action_check, part_view_action_exec);
/* create property editor */
- bst_item_view_build_param_view (iview, gxk_radget_find (radget, "property-area"));
+ bst_item_view_build_param_view (iview, (GtkContainer*) gxk_radget_find (radget, "property-area"));
}
static void
@@ -77,7 +77,7 @@ popup_part_dialog (BstPartView *part_view)
GtkWidget *pdialog;
part = bst_item_view_get_current (BST_ITEM_VIEW (part_view));
- pdialog = g_object_new (BST_TYPE_PART_DIALOG, NULL);
+ pdialog = (GtkWidget*) g_object_new (BST_TYPE_PART_DIALOG, NULL);
bst_part_dialog_set_proxy (BST_PART_DIALOG (pdialog), part);
g_signal_connect_object (part_view, "destroy", G_CALLBACK (gtk_widget_destroy), pdialog, G_CONNECT_SWAPPED);
diff --git a/beast-gtk/bstpatterncolumns.c b/beast-gtk/bstpatterncolumns.cc
similarity index 91%
rename from beast-gtk/bstpatterncolumns.c
rename to beast-gtk/bstpatterncolumns.cc
index a54f4c5..e3ecf1d 100644
--- a/beast-gtk/bstpatterncolumns.c
+++ b/beast-gtk/bstpatterncolumns.cc
@@ -45,7 +45,7 @@ playout_calc_char_extents (PangoLayout *pango_layout,
const gchar *chars,
gboolean reduce_to_ink_width)
{
- gint mlwidth = 0, miwidth = 0;
+ int mlwidth = 0, miwidth = 0;
while (chars[0])
{
PangoRectangle irect = { 0, }, lrect = { 0 };
@@ -95,7 +95,7 @@ pattern_column_note_width_request (BstPatternColumn *column,
guint duration)
{
BstPatternColumnNote *self = (BstPatternColumnNote*) column;
- gint width;
+ int width;
playout_calc_char_extents (pango_layout, &self->co0, &self->cw0, "*-# ", TRUE);
self->co0 += 1;
self->cw0 += 1 + 1;
@@ -311,7 +311,7 @@ pattern_column_event_to_string (BstPatternColumn *column,
gchar buffer[64],
BsePartControl *pctrl,
gchar placeholder,
- guint *ivalue_p)
+ int *ivalue_p)
{
gboolean is_signed = (column->lflags & BST_PATTERN_LFLAG_SIGNED) != 0;
guint num_type = column->lflags & BST_PATTERN_LFLAG_NUM_MASK;
@@ -389,17 +389,20 @@ pattern_column_event_value_from_string (BstPatternColumn *column,
return pattern_column_event_value_from_int (column, ival);
}
-static guint
-pattern_column_control_type (BstPatternColumn *column,
- gboolean *isnote_p)
+static BseMidiSignalType
+pattern_column_control_type (BstPatternColumn *column, bool *isnote_p)
{
- gboolean isnote = FALSE;
- guint control_type = column->ltype;
- if (control_type == BST_PATTERN_LTYPE_VELOCITY ||
- control_type == BST_PATTERN_LTYPE_FINE_TUNE)
- isnote = TRUE;
+ BseMidiSignalType control_type;
+ bool isnote = true;
+ if (column->ltype == BST_PATTERN_LTYPE_VELOCITY)
+ control_type = BSE_MIDI_SIGNAL_VELOCITY;
+ else if (column->ltype == BST_PATTERN_LTYPE_FINE_TUNE)
+ control_type = BSE_MIDI_SIGNAL_FINE_TUNE;
else
- control_type = BSE_MIDI_SIGNAL_CONTINUOUS_0 + column->num;
+ {
+ control_type = BseMidiSignalType (BSE_MIDI_SIGNAL_CONTINUOUS_0 + column->num);
+ isnote = false;
+ }
if (isnote_p)
*isnote_p = isnote;
return control_type;
@@ -416,7 +419,7 @@ pattern_column_event_lookup (BstPatternColumn *column,
BsePartControl *pctrl = NULL;
BsePartControlSeq *cseq;
guint control_type = pattern_column_control_type (column, NULL);
- cseq = bse_part_get_channel_controls (pview->proxy, column->num, tick, duration, control_type);
+ cseq = bse_part_get_channel_controls (pview->proxy, column->num, tick, duration, BseMidiSignalType (control_type));
if ((!cseq || cseq->n_pcontrols < 1) && placeholder_p)
*placeholder_p = '-';
else if (cseq && cseq->n_pcontrols == 1)
@@ -449,11 +452,11 @@ pattern_column_event_draw_cell (BstPatternColumn *column,
gchar placeholder = 0;
BsePartControl *pctrl = pattern_column_event_lookup (column, pview, tick, duration, NULL, &placeholder);
gchar buffer[64] = { 0, };
- guint n = pattern_column_event_to_string (column, buffer, pctrl, placeholder, NULL);
+ int n = pattern_column_event_to_string (column, buffer, pctrl, placeholder, NULL);
GdkGC *draw_gc = placeholder == '-' ? inactive_gc : text_gc;
- gint i, yline, accu = crect->x + FOCUS_WIDTH (pview) + 1;
+ int yline, accu = crect->x + FOCUS_WIDTH (pview) + 1;
- for (i = 0; i < n; i++)
+ for (int i = 0; i < n; i++)
{
PangoRectangle irect, prect;
pango_layout_set_text (pango_layout, buffer + i, 1);
@@ -508,7 +511,7 @@ pattern_column_event_key_event (BstPatternColumn *column,
BsePartControlSeq *cseq;
BsePartControl *pctrl = pattern_column_event_lookup (column, pview, tick, duration, &cseq, &placeholder);
gchar buffer[64] = { 0, };
- gint ivalue, handled = FALSE;
+ int ivalue, handled = FALSE;
pattern_column_event_to_string (column, buffer, pctrl, placeholder, &ivalue);
if (action == BST_PATTERN_REMOVE_EVENTS)
{
@@ -524,8 +527,8 @@ pattern_column_event_key_event (BstPatternColumn *column,
{
guint digit = column->n_focus_positions - focus_pos;
gint dmax = control_get_max (num_type, 1);
- gboolean isnote;
- guint control_type = pattern_column_control_type (column, &isnote);
+ bool isnote;
+ BseMidiSignalType control_type = pattern_column_control_type (column, &isnote);
gfloat value;
ivalue = MIN (param, dmax) * control_get_digit_increment (num_type, digit);
value = pattern_column_event_value_from_int (column, ivalue);
@@ -534,7 +537,7 @@ pattern_column_event_key_event (BstPatternColumn *column,
else
bst_gui_error_bell (pview);
}
- else if (pctrl && focus_pos < strlen (buffer) && !(modifier & (GDK_CONTROL_MASK | GDK_MOD1_MASK)))
+ else if (pctrl && focus_pos < (int) strlen (buffer) && !(modifier & (GDK_CONTROL_MASK | GDK_MOD1_MASK)))
{
gfloat value = 0;
gchar *newstr = g_strdup (buffer);
@@ -634,7 +637,7 @@ pattern_column_vbar_draw_cell (BstPatternColumn *self,
guint8 dash[3] = { 2, 2, 0 };
gdk_gc_set_line_attributes (draw_gc, line_width, GDK_LINE_ON_OFF_DASH, GDK_CAP_BUTT, GDK_JOIN_MITER);
dlen = dash[0] + dash[1];
- gdk_gc_set_dashes (draw_gc, (Y_OFFSET (pview) + crect->y + 1) % dlen, dash, 2);
+ gdk_gc_set_dashes (draw_gc, (Y_OFFSET (pview) + crect->y + 1) % dlen, (gint8*) dash, 2);
}
if (self->num)
gdk_draw_line (drawable, draw_gc,
@@ -668,8 +671,8 @@ static BstPatternColumnClass pattern_column_vbar_class = {
static void
pattern_column_layouter_apply (GtkWidget *dialog)
{
- BstPatternView *pview = g_object_get_data (dialog, "user_data");
- GtkEntry *entry = gxk_radget_find (dialog, "layout-entry");
+ BstPatternView *pview = (BstPatternView*) g_object_get_data ((GObject*) dialog, "user_data");
+ GtkEntry *entry = (GtkEntry*) gxk_radget_find (dialog, "layout-entry");
const gchar *layout = gtk_entry_get_text (entry);
guint l = bst_pattern_view_set_layout (pview, layout);
if (l < strlen (layout))
@@ -718,17 +721,17 @@ bst_pattern_column_layouter_popup (BstPatternView *pview)
N_("EXAMPLE:"), "\n",
__("note-1 | velocity-1=hex2 | note-2 | volume=hex4"), "\n",
};
- GtkWidget *dialog = g_object_get_data (pview, "BstPattern-layouter");
+ GtkWidget *dialog = (GtkWidget*) g_object_get_data ((GObject*) pview, "BstPattern-layouter");
GtkEntry *entry;
if (!dialog)
{
GtkWidget *sctext, *w;
guint i;
- dialog = gxk_dialog_new_radget (NULL, GTK_OBJECT (pview),
- GXK_DIALOG_HIDE_ON_DELETE | GXK_DIALOG_POPUP_POS, // GXK_DIALOG_MODAL
- _("Pattern Editor Layout"),
- "beast", "pattern-editor-layout-box");
- sctext = gxk_scroll_text_create_for (GXK_SCROLL_TEXT_WIDGET_LOOK, gxk_radget_find (dialog, "sctext-box"));
+ dialog = (GtkWidget*) gxk_dialog_new_radget (NULL, GTK_OBJECT (pview),
+ GXK_DIALOG_HIDE_ON_DELETE | GXK_DIALOG_POPUP_POS, // GXK_DIALOG_MODAL
+ _("Pattern Editor Layout"),
+ "beast", "pattern-editor-layout-box");
+ sctext = (GtkWidget*) gxk_scroll_text_create_for (GXK_SCROLL_TEXT_WIDGET_LOOK, (GtkWidget*) gxk_radget_find (dialog, "sctext-box"));
gxk_scroll_text_clear (sctext);
for (i = 0; i < G_N_ELEMENTS (help_text); i++)
{
@@ -746,13 +749,13 @@ bst_pattern_column_layouter_popup (BstPatternView *pview)
}
g_signal_connect (gxk_radget_find (dialog, "cancel-button"), "clicked",
G_CALLBACK (gxk_toplevel_delete), NULL);
- g_signal_connect_swapped (w = gxk_radget_find (dialog, "apply-button"), "clicked",
- G_CALLBACK (pattern_column_layouter_apply), dialog);
+ w = (GtkWidget*) gxk_radget_find (dialog, "apply-button");
+ g_signal_connect_swapped (w, "clicked", G_CALLBACK (pattern_column_layouter_apply), dialog);
gxk_dialog_set_default (GXK_DIALOG (dialog), w);
- g_object_set_data (dialog, "user_data", pview);
- g_object_set_data (pview, "BstPattern-layouter", dialog);
+ g_object_set_data ((GObject*) dialog, "user_data", pview);
+ g_object_set_data ((GObject*) pview, "BstPattern-layouter", dialog);
}
- entry = gxk_radget_find (dialog, "layout-entry");
+ entry = (GtkEntry*) gxk_radget_find (dialog, "layout-entry");
gtk_entry_set_text (entry, bst_pattern_view_get_layout (pview));
gxk_widget_showraise (dialog);
}
@@ -763,7 +766,7 @@ bst_pattern_layout_parse_column (const gchar *string,
gint *num,
BstPatternLFlags *flags)
{
- static const struct { const gchar *name; guint with_num, type; } coltypes[] = {
+ static const struct { const gchar *name; uint with_num; BstPatternLType type; } coltypes[] = {
{ "note-", 1, BST_PATTERN_LTYPE_NOTE },
{ "offset-", 1, BST_PATTERN_LTYPE_OFFSET },
{ "length-", 1, BST_PATTERN_LTYPE_LENGTH },
@@ -777,7 +780,7 @@ bst_pattern_layout_parse_column (const gchar *string,
{ "dbar", 0, BST_PATTERN_LTYPE_DBAR },
{ ":", 0, BST_PATTERN_LTYPE_DBAR },
};
- static const struct { const gchar *name; guint flag, mask; } colflags[] = {
+ static const struct { const gchar *name; BstPatternLFlags flag, mask; } colflags[] = {
#define NUM_MASK (BST_PATTERN_LFLAG_NUM_MASK | BST_PATTERN_LFLAG_SIGNED)
{ "hex1", BST_PATTERN_LFLAG_HEX | BST_PATTERN_LFLAG_DIGIT_1, NUM_MASK },
{ "hex2", BST_PATTERN_LFLAG_HEX | BST_PATTERN_LFLAG_DIGIT_2, NUM_MASK },
@@ -802,10 +805,10 @@ bst_pattern_layout_parse_column (const gchar *string,
{ "lfold", BST_PATTERN_LFLAG_LFOLD, BST_PATTERN_LFLAG_LFOLD },
{ "rfold", BST_PATTERN_LFLAG_RFOLD, BST_PATTERN_LFLAG_RFOLD },
};
- guint i, fmask = 0;
- *ltype = 0;
+ uint i, fmask = 0;
+ *ltype = BST_PATTERN_LTYPE_SPACE;
*num = 0;
- *flags = 0;
+ *flags = BstPatternLFlags (0);
/* parse type */
for (i = 0; i < G_N_ELEMENTS (coltypes); i++)
if (strncmp (string, coltypes[i].name, strlen (coltypes[i].name)) == 0)
@@ -825,7 +828,7 @@ bst_pattern_layout_parse_column (const gchar *string,
string++;
if (string == p)
return string; /* failed */
- mem = g_memdup (p, string - p);
+ mem = (char*) g_memdup (p, string - p);
*num = g_ascii_strtoull (mem, NULL, 10);
g_free (mem);
}
@@ -856,42 +859,42 @@ bst_pattern_column_create (BstPatternLType ltype,
gint num,
BstPatternLFlags lflags)
{
- BstPatternColumnClass *class = NULL;
+ BstPatternColumnClass *klass = NULL;
BstPatternColumn *column;
switch (ltype)
{
case BST_PATTERN_LTYPE_OFFSET:
case BST_PATTERN_LTYPE_LENGTH:
case BST_PATTERN_LTYPE_SPACE:
- class = &pattern_column_vbar_class;
+ klass = &pattern_column_vbar_class;
num = 0;
break;
case BST_PATTERN_LTYPE_BAR:
- class = &pattern_column_vbar_class;
+ klass = &pattern_column_vbar_class;
num = 1;
break;
case BST_PATTERN_LTYPE_DBAR:
- class = &pattern_column_vbar_class;
+ klass = &pattern_column_vbar_class;
num = -1;
break;
case BST_PATTERN_LTYPE_NOTE:
- class = &pattern_column_note_class;
+ klass = &pattern_column_note_class;
break;
case BST_PATTERN_LTYPE_VELOCITY:
case BST_PATTERN_LTYPE_FINE_TUNE:
case BST_PATTERN_LTYPE_CONTROL:
- class = &pattern_column_event_class;
+ klass = &pattern_column_event_class;
break;
}
- g_assert (class->instance_size >= sizeof (BstPatternColumn));
- column = g_malloc0 (class->instance_size);
- column->klass = class;
+ g_assert (klass->instance_size >= sizeof (BstPatternColumn));
+ column = (BstPatternColumn*) g_malloc0 (klass->instance_size);
+ column->klass = klass;
column->num = num;
column->ltype = ltype;
column->lflags = lflags;
- column->n_focus_positions = class->n_focus_positions;
- if (class->init)
- class->init (column);
+ column->n_focus_positions = klass->n_focus_positions;
+ if (klass->init)
+ klass->init (column);
return column;
}
diff --git a/beast-gtk/bstpatterncolumns.h b/beast-gtk/bstpatterncolumns.h
index 0984686..11587f6 100644
--- a/beast-gtk/bstpatterncolumns.h
+++ b/beast-gtk/bstpatterncolumns.h
@@ -31,11 +31,11 @@ typedef enum /*< skip >*/
BST_PATTERN_SET_OCTAVE, /* #octave */
BST_PATTERN_NUMERIC_CHANGE, /* -32 .. +32 */
BST_PATTERN_SET_DIGIT, /* 0 .. +32 */
-#define BST_PATTERN_MASK_ACTION (0x000000ff)
+ BST_PATTERN_MASK_ACTION = 0x000000ff,
/* base octave */
BST_PATTERN_SET_BASE_OCTAVE = 0x1 << 8,
BST_PATTERN_CHANGE_BASE_OCTAVE = 0x2 << 8,
-#define BST_PATTERN_MASK_CONTROLS (0x0000ff00)
+ BST_PATTERN_MASK_CONTROLS = 0x0000ff00,
/* focus movement */
BST_PATTERN_MOVE_LEFT = 0x1 << 16,
BST_PATTERN_MOVE_RIGHT = 0x2 << 16,
@@ -51,7 +51,7 @@ typedef enum /*< skip >*/
BST_PATTERN_JUMP_BOTTOM = 0xc << 16,
BST_PATTERN_MOVE_NEXT = 0xd << 16,
BST_PATTERN_SET_STEP_WIDTH = 0xe << 16,
-#define BST_PATTERN_MASK_MOVEMENT (0x00ff0000)
+ BST_PATTERN_MASK_MOVEMENT = 0x00ff0000,
} BstPatternFunction;
typedef enum /*< skip >*/
{
@@ -60,6 +60,35 @@ typedef enum /*< skip >*/
BST_PATTERN_COLUMN_GC_VBAR,
BST_PATTERN_COLUMN_GC_LAST
} BstPatternColumnCellGcType;
+typedef enum {
+ BST_PATTERN_LTYPE_SPACE,
+ BST_PATTERN_LTYPE_NOTE, /* plus #channel */
+ BST_PATTERN_LTYPE_OFFSET, /* plus #channel */
+ BST_PATTERN_LTYPE_LENGTH, /* plus #channel */
+ BST_PATTERN_LTYPE_VELOCITY, /* plus #channel */
+ BST_PATTERN_LTYPE_FINE_TUNE, /* plus #channel */
+ BST_PATTERN_LTYPE_CONTROL, /* plus #control */
+ BST_PATTERN_LTYPE_BAR,
+ BST_PATTERN_LTYPE_DBAR,
+} BstPatternLType;
+typedef enum {
+ BST_PATTERN_LFLAG_DIGIT_1 = 0 << 0,
+ BST_PATTERN_LFLAG_DIGIT_2 = 1 << 0,
+ BST_PATTERN_LFLAG_DIGIT_3 = 2 << 0,
+ BST_PATTERN_LFLAG_DIGIT_4 = 3 << 0,
+ BST_PATTERN_LFLAG_DIGIT_MASK = (3 << 0),
+ BST_PATTERN_LFLAG_DEC = 0 << 2,
+ BST_PATTERN_LFLAG_HEX = 1 << 2,
+ BST_PATTERN_LFLAG_NUM_MASK = (1 << 2),
+ BST_PATTERN_LFLAG_SIGNED = 1 << 5,
+ BST_PATTERN_LFLAG_LFOLD = 1 << 6,
+ BST_PATTERN_LFLAG_RFOLD = 1 << 7,
+ BST_PATTERN_LFLAG_COL1 = 0 << 8,
+ BST_PATTERN_LFLAG_COL2 = 1 << 8,
+ BST_PATTERN_LFLAG_COL3 = 2 << 8,
+ BST_PATTERN_LFLAG_COL4 = 3 << 8,
+ BST_PATTERN_LFLAG_COL_MASK = (3 << 8),
+} BstPatternLFlags;
/* --- typedefs & structures --- */
typedef struct _BstPatternView BstPatternView;
@@ -69,16 +98,17 @@ struct _BstPatternColumn
{
BstPatternColumnClass *klass;
gint num;
- guint ltype, lflags; /* BstPatternLType, BstPatternLFlags */
- guint n_focus_positions;
+ BstPatternLType ltype;
+ BstPatternLFlags lflags;
+ int n_focus_positions;
/* fields private to BstPatternView */
- guint x;
- guint width;
- guint focus_base;
+ int x;
+ int width;
+ int focus_base;
};
struct _BstPatternColumnClass
{
- guint n_focus_positions;
+ int n_focus_positions;
guint instance_size;
void (*init) (BstPatternColumn *self);
PangoFontDescription* (*create_font_desc) (BstPatternColumn *self);
@@ -123,35 +153,6 @@ struct _BstPatternColumnClass
void (*finalize) (BstPatternColumn *self);
};
-typedef enum {
- BST_PATTERN_LTYPE_SPACE,
- BST_PATTERN_LTYPE_NOTE, /* plus #channel */
- BST_PATTERN_LTYPE_OFFSET, /* plus #channel */
- BST_PATTERN_LTYPE_LENGTH, /* plus #channel */
- BST_PATTERN_LTYPE_VELOCITY, /* plus #channel */
- BST_PATTERN_LTYPE_FINE_TUNE, /* plus #channel */
- BST_PATTERN_LTYPE_CONTROL, /* plus #control */
- BST_PATTERN_LTYPE_BAR,
- BST_PATTERN_LTYPE_DBAR,
-} BstPatternLType;
-typedef enum {
- BST_PATTERN_LFLAG_DIGIT_1 = 0 << 0,
- BST_PATTERN_LFLAG_DIGIT_2 = 1 << 0,
- BST_PATTERN_LFLAG_DIGIT_3 = 2 << 0,
- BST_PATTERN_LFLAG_DIGIT_4 = 3 << 0,
-#define BST_PATTERN_LFLAG_DIGIT_MASK (3 << 0)
- BST_PATTERN_LFLAG_DEC = 0 << 2,
- BST_PATTERN_LFLAG_HEX = 1 << 2,
-#define BST_PATTERN_LFLAG_NUM_MASK (1 << 2)
- BST_PATTERN_LFLAG_SIGNED = 1 << 5,
- BST_PATTERN_LFLAG_LFOLD = 1 << 6,
- BST_PATTERN_LFLAG_RFOLD = 1 << 7,
- BST_PATTERN_LFLAG_COL1 = 0 << 8,
- BST_PATTERN_LFLAG_COL2 = 1 << 8,
- BST_PATTERN_LFLAG_COL3 = 2 << 8,
- BST_PATTERN_LFLAG_COL4 = 3 << 8,
-#define BST_PATTERN_LFLAG_COL_MASK (3 << 8)
-} BstPatternLFlags;
void bst_pattern_column_layouter_popup (BstPatternView *pview);
const gchar* bst_pattern_layout_parse_column (const gchar *string,
BstPatternLType *ltype,
@@ -164,4 +165,19 @@ gboolean bst_pattern_column_has_notes (BstPatternColumn *column);
G_END_DECLS
+// == Flags Enumeration Operators in C++ ==
+#ifdef __cplusplus
+inline BstPatternLFlags operator& (BstPatternLFlags s1, BstPatternLFlags s2) { return BstPatternLFlags (s1 & (long long unsigned) s2); }
+inline BstPatternLFlags& operator&= (BstPatternLFlags &s1, BstPatternLFlags s2) { s1 = s1 & s2; return s1; }
+inline BstPatternLFlags operator| (BstPatternLFlags s1, BstPatternLFlags s2) { return BstPatternLFlags (s1 | (long long unsigned) s2); }
+inline BstPatternLFlags& operator|= (BstPatternLFlags &s1, BstPatternLFlags s2) { s1 = s1 | s2; return s1; }
+inline BstPatternLFlags operator~ (BstPatternLFlags s1) { return BstPatternLFlags (~(long long unsigned) s1); }
+
+inline BstPatternFunction operator& (BstPatternFunction s1, BstPatternFunction s2) { return BstPatternFunction (s1 & (long long unsigned) s2); }
+inline BstPatternFunction& operator&= (BstPatternFunction &s1, BstPatternFunction s2) { s1 = s1 & s2; return s1; }
+inline BstPatternFunction operator| (BstPatternFunction s1, BstPatternFunction s2) { return BstPatternFunction (s1 | (long long unsigned) s2); }
+inline BstPatternFunction& operator|= (BstPatternFunction &s1, BstPatternFunction s2) { s1 = s1 | s2; return s1; }
+inline BstPatternFunction operator~ (BstPatternFunction s1) { return BstPatternFunction (~(long long unsigned) s1); }
+#endif // __cplusplus
+
#endif /* __BST_PATTERN_COLUMNS_H__ */
diff --git a/beast-gtk/bstpatternctrl.c b/beast-gtk/bstpatternctrl.cc
similarity index 83%
rename from beast-gtk/bstpatternctrl.c
rename to beast-gtk/bstpatternctrl.cc
index 9d21ae6..cf87a2f 100644
--- a/beast-gtk/bstpatternctrl.c
+++ b/beast-gtk/bstpatternctrl.cc
@@ -30,7 +30,7 @@ static void
pattern_controller_vraster_notify (gpointer notify_data,
GxkParam *param)
{
- BstPatternController *self = notify_data;
+ BstPatternController *self = (BstPatternController*) notify_data;
BstPatternView *pview = self->pview;
static const struct { int value, ticks; } choices[] = {
{ BST_NOTE_LENGTH_1, 1536 }, /* 4 * 384 */
@@ -73,7 +73,7 @@ static void
pattern_controller_row_shading_notify (gpointer notify_data,
GxkParam *param)
{
- BstPatternController *self = notify_data;
+ BstPatternController *self = (BstPatternController*) notify_data;
BstPatternView *pview = self->pview;
static const struct { int value, r1, r2, r3, r4; } choices[] = {
{ BST_ROW_SHADING_NONE, 0, 0, 0, 0 },
@@ -149,7 +149,7 @@ bst_pattern_controller_new (BstPatternView *pview,
G_CALLBACK (pattern_controller_key_press),
self, (GClosureNotify) bst_pattern_controller_unref,
G_CONNECT_SWAPPED);
- self->quant_rtools = quant_rtools ? g_object_ref (quant_rtools) : NULL;
+ self->quant_rtools = quant_rtools ? (GxkActionGroup*) g_object_ref (quant_rtools) : NULL;
pattern_controller_vraster_notify (self, NULL);
pattern_controller_row_shading_notify (self, NULL);
@@ -197,28 +197,29 @@ pattern_controller_key_press (BstPatternController *self,
{
BstPatternView *pview = self->pview;
BstPatternColumn *col = bst_pattern_view_get_focus_cell (pview, NULL, NULL);
- BstPatternFunction movement, ftype = 0;
+ BstPatternFunction movement, ftype = BstPatternFunction (0);
gdouble param = 0;
gboolean handled;
gint base_octave, note;
- guint state = event->state, g = col->klass->collision_group;
+ GdkModifierType state = GdkModifierType (event->state);
+ uint g = col->klass->collision_group;
if (!ftype && g)
- ftype = bst_key_binding_lookup_id (bst_pattern_controller_piano_keys(), event->keyval, state, g, ¶m);
+ ftype = (BstPatternFunction) bst_key_binding_lookup_id (bst_pattern_controller_piano_keys(), event->keyval, state, g, ¶m);
if (!ftype)
- ftype = bst_key_binding_lookup_id (bst_pattern_controller_piano_keys(), event->keyval, state, 0, ¶m);
+ ftype = (BstPatternFunction) bst_key_binding_lookup_id (bst_pattern_controller_piano_keys(), event->keyval, state, 0, ¶m);
if (!ftype && g)
- ftype = bst_key_binding_lookup_id (bst_pattern_controller_generic_keys(), event->keyval, state, g, ¶m);
+ ftype = (BstPatternFunction) bst_key_binding_lookup_id (bst_pattern_controller_generic_keys(), event->keyval, state, g, ¶m);
if (!ftype)
- ftype = bst_key_binding_lookup_id (bst_pattern_controller_generic_keys(), event->keyval, state, 0, ¶m);
- state = event->state & ~GDK_SHIFT_MASK;
+ ftype = (BstPatternFunction) bst_key_binding_lookup_id (bst_pattern_controller_generic_keys(), event->keyval, state, 0, ¶m);
+ state = GdkModifierType (event->state) & ~GDK_SHIFT_MASK;
if (!ftype && g)
- ftype = bst_key_binding_lookup_id (bst_pattern_controller_piano_keys(), event->keyval, state, g, ¶m);
+ ftype = (BstPatternFunction) bst_key_binding_lookup_id (bst_pattern_controller_piano_keys(), event->keyval, state, g, ¶m);
if (!ftype)
- ftype = bst_key_binding_lookup_id (bst_pattern_controller_piano_keys(), event->keyval, state, 0, ¶m);
+ ftype = (BstPatternFunction) bst_key_binding_lookup_id (bst_pattern_controller_piano_keys(), event->keyval, state, 0, ¶m);
if (!ftype && g)
- ftype = bst_key_binding_lookup_id (bst_pattern_controller_generic_keys(), event->keyval, state, g, ¶m);
+ ftype = (BstPatternFunction) bst_key_binding_lookup_id (bst_pattern_controller_generic_keys(), event->keyval, state, g, ¶m);
if (!ftype)
- ftype = bst_key_binding_lookup_id (bst_pattern_controller_generic_keys(), event->keyval, state, 0, ¶m);
+ ftype = (BstPatternFunction) bst_key_binding_lookup_id (bst_pattern_controller_generic_keys(), event->keyval, state, 0, ¶m);
switch (ftype & BST_PATTERN_MASK_ACTION)
{
case BST_PATTERN_SET_NOTE:
@@ -231,6 +232,7 @@ pattern_controller_key_press (BstPatternController *self,
note -= 12;
param = note;
break;
+ default: ;
}
switch (ftype & BST_PATTERN_MASK_CONTROLS)
{
@@ -245,13 +247,14 @@ pattern_controller_key_press (BstPatternController *self,
sfi_value_set_int (&self->base_octave->value, base_octave);
gxk_param_update (self->base_octave); /* we poked the params value */
break;
+ default: ;
}
movement = ftype & BST_PATTERN_MASK_MOVEMENT;
- handled = bst_pattern_view_dispatch_key (pview, event->keyval, event->state, ftype & BST_PATTERN_MASK_ACTION, param, &movement);
+ handled = bst_pattern_view_dispatch_key (pview, event->keyval, GdkModifierType (event->state), ftype & BST_PATTERN_MASK_ACTION, param, &movement);
if (movement == BST_PATTERN_MOVE_NEXT && /* if the standard step-next movement */
(event->state & GDK_SHIFT_MASK) && /* is blocked by shift */
(movement != ftype || handled)) /* and this is not purely "next" */
- movement = 0; /* honour the block */
+ movement = BstPatternFunction (0); /* honour the block */
if (movement)
{
const guint channel_page = 2, row_page = 4;
@@ -309,19 +312,19 @@ pattern_controller_get_functions (gboolean want_piano,
{
static BstKeyBindingFunction generic_funcs[] = {
/* movement */
- { BST_PATTERN_MOVE_NEXT, "next", 0, N_("Move focus to the next cell (up/left/right/down according to configuration)") },
- { BST_PATTERN_MOVE_UP, "move-up", 0, N_("Move focus cell upwards") },
- { BST_PATTERN_MOVE_LEFT, "move-left", 0, N_("Move focus cell to the left") },
- { BST_PATTERN_MOVE_RIGHT, "move-right", 0, N_("Move focus cell to the right") },
- { BST_PATTERN_MOVE_DOWN, "move-down", 0, N_("Move focus cell downwards") },
- { BST_PATTERN_PAGE_UP, "page-up", 0, N_("Move focus cell upwards page-wise") },
- { BST_PATTERN_PAGE_LEFT, "page-left", 0, N_("Move focus cell to the left page-wise") },
- { BST_PATTERN_PAGE_RIGHT, "page-right", 0, N_("Move focus cell to the right page-wise") },
- { BST_PATTERN_PAGE_DOWN, "page-down", 0, N_("Move focus cell downwards page-wise") },
- { BST_PATTERN_JUMP_TOP, "jump-top", 0, N_("Set the focus cell to the topmost position possible") },
- { BST_PATTERN_JUMP_LEFT, "jump-left", 0, N_("Set the focus cell to the leftmost position possible") },
- { BST_PATTERN_JUMP_RIGHT, "jump-right", 0, N_("Set the focus cell to the rightmost position possible") },
- { BST_PATTERN_JUMP_BOTTOM, "jump-bottom", 0, N_("Set the focus cell to the bottommost position possible") },
+ { BST_PATTERN_MOVE_NEXT, "next", BST_KEY_BINDING_PARAM_NONE, N_("Move focus to the next cell (up/left/right/down according to configuration)") },
+ { BST_PATTERN_MOVE_UP, "move-up", BST_KEY_BINDING_PARAM_NONE, N_("Move focus cell upwards") },
+ { BST_PATTERN_MOVE_LEFT, "move-left", BST_KEY_BINDING_PARAM_NONE, N_("Move focus cell to the left") },
+ { BST_PATTERN_MOVE_RIGHT, "move-right", BST_KEY_BINDING_PARAM_NONE, N_("Move focus cell to the right") },
+ { BST_PATTERN_MOVE_DOWN, "move-down", BST_KEY_BINDING_PARAM_NONE, N_("Move focus cell downwards") },
+ { BST_PATTERN_PAGE_UP, "page-up", BST_KEY_BINDING_PARAM_NONE, N_("Move focus cell upwards page-wise") },
+ { BST_PATTERN_PAGE_LEFT, "page-left", BST_KEY_BINDING_PARAM_NONE, N_("Move focus cell to the left page-wise") },
+ { BST_PATTERN_PAGE_RIGHT, "page-right", BST_KEY_BINDING_PARAM_NONE, N_("Move focus cell to the right page-wise") },
+ { BST_PATTERN_PAGE_DOWN, "page-down", BST_KEY_BINDING_PARAM_NONE, N_("Move focus cell downwards page-wise") },
+ { BST_PATTERN_JUMP_TOP, "jump-top", BST_KEY_BINDING_PARAM_NONE, N_("Set the focus cell to the topmost position possible") },
+ { BST_PATTERN_JUMP_LEFT, "jump-left", BST_KEY_BINDING_PARAM_NONE, N_("Set the focus cell to the leftmost position possible") },
+ { BST_PATTERN_JUMP_RIGHT, "jump-right", BST_KEY_BINDING_PARAM_NONE, N_("Set the focus cell to the rightmost position possible") },
+ { BST_PATTERN_JUMP_BOTTOM, "jump-bottom", BST_KEY_BINDING_PARAM_NONE, N_("Set the focus cell to the bottommost position possible") },
{ BST_PATTERN_SET_STEP_WIDTH,
"set-step-width", BST_KEY_BINDING_PARAM_SHORT,
N_("Set the number of steps to make when moving to the next cell") },
@@ -342,7 +345,7 @@ pattern_controller_get_functions (gboolean want_piano,
N_("Set the focus cell octave") },
/* events */
{ BST_PATTERN_REMOVE_EVENTS | BST_PATTERN_MOVE_NEXT,
- "remove-events", 0,
+ "remove-events", BST_KEY_BINDING_PARAM_NONE,
N_("Remove any events in the focus cell"), 0 },
/* notes */
{ BST_PATTERN_SET_NOTE | BST_PATTERN_MOVE_NEXT,
@@ -356,7 +359,7 @@ pattern_controller_get_functions (gboolean want_piano,
static BstKeyBindingFunction piano_funcs[] = {
/* events */
{ BST_PATTERN_REMOVE_EVENTS | BST_PATTERN_MOVE_NEXT,
- "remove-events", 0,
+ "remove-events", BST_KEY_BINDING_PARAM_NONE,
N_("Remove any events in the focus cell"), 0 },
/* notes */
{ BST_PATTERN_SET_NOTE | BST_PATTERN_MOVE_NEXT,
@@ -389,10 +392,25 @@ pattern_controller_get_functions (gboolean want_piano,
}
}
+struct ConstKeyBindingItem {
+ const char* key_name;
+ const char* func_name;
+ SfiReal func_param;
+};
+static BstKeyBindingItem*
+BstKeyBindingItem_from_ConstKeyBindingItem (const ConstKeyBindingItem *ckb)
+{
+ BIRNET_STATIC_ASSERT (sizeof (ConstKeyBindingItem) == sizeof (BstKeyBindingItem));
+ BIRNET_STATIC_ASSERT (offsetof (ConstKeyBindingItem, key_name) == offsetof (BstKeyBindingItem, key_name));
+ BIRNET_STATIC_ASSERT (offsetof (ConstKeyBindingItem, func_name) == offsetof (BstKeyBindingItem, func_name));
+ BIRNET_STATIC_ASSERT (offsetof (ConstKeyBindingItem, func_param) == offsetof (BstKeyBindingItem, func_param));
+ return (BstKeyBindingItem*) ckb;
+}
+
BstKeyBinding*
bst_pattern_controller_default_generic_keys (void)
{
- static BstKeyBindingItem dflt_keys[] = {
+ static ConstKeyBindingItem dflt_keys[] = {
/* move in cells */
{ "Up", "move-up", 0 },
{ "KP_Up", "move-up", 0 },
@@ -487,7 +505,7 @@ bst_pattern_controller_default_generic_keys (void)
{ "<Control>" "KP_Subtract", "change-base-octave", -1 },
// keypad: "KP_Insert"/*0*/, "KP_Delete"/*,*/
};
- static BstKeyBinding kbinding = { "pattern-controller-default-generic-keys", };
+ static BstKeyBinding kbinding = { (char*) "pattern-controller-default-generic-keys", };
if (!kbinding.n_funcs)
{
BstKeyBindingItemSeq *iseq;
@@ -496,7 +514,7 @@ bst_pattern_controller_default_generic_keys (void)
/* setup default keys */
iseq = bst_key_binding_item_seq_new();
for (i = 0; i < G_N_ELEMENTS (dflt_keys); i++)
- bst_key_binding_item_seq_append (iseq, &dflt_keys[i]);
+ bst_key_binding_item_seq_append (iseq, BstKeyBindingItem_from_ConstKeyBindingItem (&dflt_keys[i]));
bst_key_binding_set_item_seq (&kbinding, iseq);
bst_key_binding_item_seq_free (iseq);
}
@@ -506,11 +524,11 @@ bst_pattern_controller_default_generic_keys (void)
BstKeyBinding*
bst_pattern_controller_default_piano_keys (void)
{
- static BstKeyBindingItem dflt_keys[] = {
+ static ConstKeyBindingItem dflt_keys[] = {
/* events */
{ "space", "remove-events", 0 },
};
- static BstKeyBinding kbinding = { "pattern-controller-default-piano-keys", };
+ static BstKeyBinding kbinding = { (char*) "pattern-controller-default-piano-keys", };
if (!kbinding.n_funcs)
{
BstKeyBindingItemSeq *iseq;
@@ -519,7 +537,7 @@ bst_pattern_controller_default_piano_keys (void)
/* setup default keys */
iseq = bst_key_binding_item_seq_new();
for (i = 0; i < G_N_ELEMENTS (dflt_keys); i++)
- bst_key_binding_item_seq_append (iseq, &dflt_keys[i]);
+ bst_key_binding_item_seq_append (iseq, BstKeyBindingItem_from_ConstKeyBindingItem (&dflt_keys[i]));
bst_key_binding_set_item_seq (&kbinding, iseq);
bst_key_binding_item_seq_free (iseq);
}
@@ -529,7 +547,7 @@ bst_pattern_controller_default_piano_keys (void)
BstKeyBinding*
bst_pattern_controller_generic_keys (void)
{
- static BstKeyBinding kbinding = { "pattern-controller-generic-keys", };
+ static BstKeyBinding kbinding = { (char*) "pattern-controller-generic-keys", };
if (!kbinding.n_funcs)
{
BstKeyBinding *dflt_kbinding = bst_pattern_controller_default_generic_keys();
@@ -546,7 +564,7 @@ bst_pattern_controller_generic_keys (void)
BstKeyBinding*
bst_pattern_controller_piano_keys (void)
{
- static BstKeyBinding kbinding = { "pattern-controller-piano-keys", };
+ static BstKeyBinding kbinding = { (char*) "pattern-controller-piano-keys", };
if (!kbinding.n_funcs)
{
BstKeyBinding *dflt_kbinding = bst_pattern_controller_default_piano_keys();
diff --git a/beast-gtk/bstpatternview.c b/beast-gtk/bstpatternview.cc
similarity index 96%
rename from beast-gtk/bstpatternview.c
rename to beast-gtk/bstpatternview.cc
index acced0f..5c63898 100644
--- a/beast-gtk/bstpatternview.c
+++ b/beast-gtk/bstpatternview.cc
@@ -76,10 +76,10 @@ enum {
};
static void
-pattern_view_class_setup_skin (BstPatternViewClass *class)
+pattern_view_class_setup_skin (BstPatternViewClass *klass)
{
static GdkColor colors[CINDEX_LAST];
- GxkScrollCanvasClass *scroll_canvas_class = GXK_SCROLL_CANVAS_CLASS (class);
+ GxkScrollCanvasClass *scroll_canvas_class = GXK_SCROLL_CANVAS_CLASS (klass);
scroll_canvas_class->n_colors = G_N_ELEMENTS (colors);
scroll_canvas_class->colors = colors;
colors[CINDEX_SHADE1] = gdk_color_from_rgb (BST_SKIN_CONFIG (pattern_scolor1));
@@ -227,7 +227,7 @@ pattern_view_column_pango_layout (BstPatternView *self,
BstPatternColumn *col)
{
GxkScrollCanvas *scc = GXK_SCROLL_CANVAS (self);
- gint i;
+ uint i;
for (i = 0; i < self->n_cols; i++)
if (self->cols[i] == col)
break;
@@ -307,7 +307,7 @@ row_to_ticks (BstPatternView *self,
gint *tick_p,
gint *duration_p)
{
- gint tick = MIN (G_MAXINT - self->vticks, row * (double) self->vticks);
+ int tick = MIN (G_MAXINT - self->vticks, row * (double) self->vticks);
if (tick_p)
*tick_p = tick;
if (duration_p)
@@ -364,11 +364,11 @@ coord_to_focus_col (BstPatternView *self,
gint x,
gboolean *is_valid)
{
- gint i, vwidth = 0, valid = 0, focus_col = G_MAXINT, dist = G_MAXINT;
+ int i, vwidth = 0, valid = 0, focus_col = G_MAXINT, dist = G_MAXINT;
for (i = 0; i < self->n_focus_cols; i++)
{
- gint ldist = x - self->focus_cols[i]->x;
- gint rdist = x - self->focus_cols[i]->x - self->focus_cols[i]->width;
+ int ldist = x - self->focus_cols[i]->x;
+ int rdist = x - self->focus_cols[i]->x - self->focus_cols[i]->width;
if (ABS (ldist) < dist || ABS (rdist) < dist)
{
focus_col = i;
@@ -385,7 +385,7 @@ coord_to_focus_col (BstPatternView *self,
{
BstPatternColumn *col = self->focus_cols[focus_col];
GdkRectangle rect;
- gint tick, duration, fx, fw, pos = 0, cx = x - col->x;
+ int tick, duration, fx, fw, pos = 0, cx = x - col->x;
row_to_ticks (self, self->focus_row, &tick, &duration);
row_to_coords (self, self->focus_row, &rect.y, &rect.height);
rect.x = col->x;
@@ -937,14 +937,13 @@ bst_pattern_view_add_column (BstPatternView *self,
BstPatternLFlags lflags)
{
BstPatternColumn *col;
- guint i;
g_return_if_fail (BST_PATTERN_VIEW (self));
self->cols = g_renew (BstPatternColumn*, self->cols, self->n_cols + 1);
col = bst_pattern_column_create (ltype, num, lflags);
self->cols[self->n_cols++] = col;
col->focus_base = self->n_focus_cols;
- for (i = 0; i < col->n_focus_positions; i++)
+ for (int i = 0; i < col->n_focus_positions; i++)
{
self->focus_cols = g_renew (BstPatternColumn*, self->focus_cols, self->n_focus_cols + 1);
self->focus_cols[self->n_focus_cols++] = col;
@@ -967,12 +966,10 @@ bst_pattern_view_get_last_row (BstPatternView *self)
}
BstPatternColumn*
-bst_pattern_view_get_focus_cell (BstPatternView *self,
- guint *tick_p,
- guint *duration_p)
+bst_pattern_view_get_focus_cell (BstPatternView *self, int *tick_p, int *duration_p)
{
- guint focus_col = self->focus_col;
- guint focus_row = self->focus_row;
+ int focus_col = self->focus_col;
+ int focus_row = self->focus_row;
if (focus_col < self->n_focus_cols)
{
row_to_ticks (self, focus_row, tick_p, duration_p);
@@ -990,8 +987,8 @@ bst_pattern_view_dispatch_key (BstPatternView *self,
BstPatternFunction *movement)
{
GdkRectangle rect;
- guint focus_col = self->focus_col;
- guint focus_row = self->focus_row;
+ int focus_col = self->focus_col;
+ int focus_row = self->focus_row;
if (focus_col < self->n_focus_cols && row_to_coords (self, focus_row, &rect.y, &rect.height))
{
BstPatternColumn *col = self->focus_cols[focus_col];
@@ -1010,9 +1007,7 @@ bst_pattern_view_dispatch_key (BstPatternView *self,
}
void
-bst_pattern_view_set_focus (BstPatternView *self,
- guint focus_col,
- guint focus_row)
+bst_pattern_view_set_focus (BstPatternView *self, int focus_col, int focus_row)
{
GdkRectangle rect;
gint last_row;
@@ -1021,7 +1016,7 @@ bst_pattern_view_set_focus (BstPatternView *self,
focus_col = MIN (focus_col + 1, self->n_focus_cols) - 1;
last_row = bst_pattern_view_get_last_row (self);
focus_row = MIN (focus_row, last_row);
- if (focus_col < self->n_focus_cols && row_to_coords (self, focus_row, &rect.y, &rect.height))
+ if (focus_col >= 0 && focus_col < self->n_focus_cols && row_to_coords (self, focus_row, &rect.y, &rect.height))
{
GxkScrollCanvas *scc = GXK_SCROLL_CANVAS (self);
BstPatternColumn *col = self->focus_cols[focus_col];
@@ -1160,15 +1155,15 @@ bst_pattern_view_set_layout (BstPatternView *self,
const gchar *layout)
{
const gchar *p2, *p = layout;
- struct {
+ struct AuxColumn {
BstPatternLType ltype;
BstPatternLFlags flags;
- gint num;
- } *column = NULL;
- guint n = 0;
+ int num;
+ };
+ uint n = 0;
while (*p == ' ')
p++;
- column = g_realloc (column, sizeof (column[0]) * (n + 1));
+ AuxColumn *column = (AuxColumn*) g_malloc (sizeof (column[0]) * (n + 1));
p2 = bst_pattern_layout_parse_column (p, &column[n].ltype, &column[n].num, &column[n].flags);
while (p2 > p)
{
@@ -1176,7 +1171,7 @@ bst_pattern_view_set_layout (BstPatternView *self,
p = p2;
while (*p == ' ')
p++;
- column = g_realloc (column, sizeof (column[0]) * (n + 1));
+ column = (AuxColumn*) g_realloc (column, sizeof (column[0]) * (n + 1));
p2 = bst_pattern_layout_parse_column (p, &column[n].ltype, &column[n].num, &column[n].flags);
}
if (!p2[0] && n)
@@ -1206,11 +1201,11 @@ bst_pattern_view_set_shading (BstPatternView *self,
}
static void
-bst_pattern_view_class_init (BstPatternViewClass *class)
+bst_pattern_view_class_init (BstPatternViewClass *klass)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (class);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
- GxkScrollCanvasClass *scroll_canvas_class = GXK_SCROLL_CANVAS_CLASS (class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+ GxkScrollCanvasClass *scroll_canvas_class = GXK_SCROLL_CANVAS_CLASS (klass);
gobject_class->finalize = bst_pattern_view_finalize;
gobject_class->dispose = bst_pattern_view_dispose;
@@ -1231,21 +1226,21 @@ bst_pattern_view_class_init (BstPatternViewClass *class)
scroll_canvas_class->image_tint = gdk_color_from_rgb (0x00ffffff);
scroll_canvas_class->image_saturation = 0;
- class->drag = NULL;
- class->clicked = NULL;
+ klass->drag = NULL;
+ klass->clicked = NULL;
- signal_drag = g_signal_new ("drag", G_OBJECT_CLASS_TYPE (class),
+ signal_drag = g_signal_new ("drag", G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (BstPatternViewClass, drag),
NULL, NULL,
bst_marshal_NONE__POINTER,
G_TYPE_NONE, 1, G_TYPE_POINTER);
- signal_clicked = g_signal_new ("clicked", G_OBJECT_CLASS_TYPE (class),
+ signal_clicked = g_signal_new ("clicked", G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (BstPatternViewClass, clicked),
NULL, NULL,
bst_marshal_NONE__UINT_UINT_INT_BOXED,
G_TYPE_NONE, 4, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_INT,
GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
- bst_skin_config_add_notify ((BstSkinConfigNotify) pattern_view_class_setup_skin, class);
- pattern_view_class_setup_skin (class);
+ bst_skin_config_add_notify ((BstSkinConfigNotify) pattern_view_class_setup_skin, klass);
+ pattern_view_class_setup_skin (klass);
}
diff --git a/beast-gtk/bstpatternview.h b/beast-gtk/bstpatternview.h
index 7e6b64f..415e6a1 100644
--- a/beast-gtk/bstpatternview.h
+++ b/beast-gtk/bstpatternview.h
@@ -50,9 +50,9 @@ typedef struct {
gboolean start_valid;
guint current_col;
guint current_row;
- guint current_tick;
- guint current_duration;
- gboolean current_valid;
+ int current_tick;
+ int current_duration;
+ bool current_valid;
/* convenience: */
BstPatternView *pview;
} BstPatternViewDrag;
@@ -77,7 +77,7 @@ struct _BstPatternView
/* focus cell */
guint focus_col;
guint focus_row;
- guint n_focus_cols;
+ int n_focus_cols;
BstPatternColumn **focus_cols;
/* shading */
@@ -133,13 +133,9 @@ void bst_pattern_view_add_column (BstPatternView *s
BstPatternLType ltype,
gint num,
BstPatternLFlags lflags);
-void bst_pattern_view_set_focus (BstPatternView *self,
- guint focus_col,
- guint focus_row);
+void bst_pattern_view_set_focus (BstPatternView *self, int focus_col, int focus_row);
gint bst_pattern_view_get_focus_width (BstPatternView *self);
-BstPatternColumn* bst_pattern_view_get_focus_cell (BstPatternView *self,
- guint *tick,
- guint *duration);
+BstPatternColumn* bst_pattern_view_get_focus_cell (BstPatternView *self, int *tick, int *duration);
gboolean bst_pattern_view_dispatch_key (BstPatternView *self,
guint keyval,
GdkModifierType modifier,
diff --git a/beast-gtk/bstpianoroll.c b/beast-gtk/bstpianoroll.cc
similarity index 97%
rename from beast-gtk/bstpianoroll.c
rename to beast-gtk/bstpianoroll.cc
index 2f1e208..45246ba 100644
--- a/beast-gtk/bstpianoroll.c
+++ b/beast-gtk/bstpianoroll.cc
@@ -24,7 +24,7 @@
/* --- defines --- */
/* accessors */
#define STYLE(self) (GTK_WIDGET (self)->style)
-#define STATE(self) (GTK_WIDGET (self)->state)
+#define STATE(self) (GtkStateType (GTK_WIDGET (self)->state))
#define XTHICKNESS(self) (STYLE (self)->xthickness)
#define YTHICKNESS(self) (STYLE (self)->ythickness)
#define ALLOCATION(self) (>K_WIDGET (self)->allocation)
@@ -98,7 +98,7 @@ static guint signal_piano_clicked = 0;
G_DEFINE_TYPE (BstPianoRoll, bst_piano_roll, GXK_TYPE_SCROLL_CANVAS);
static void
-piano_roll_class_setup_skin (BstPianoRollClass *class)
+piano_roll_class_setup_skin (BstPianoRollClass *klass)
{
static GdkColor colors[CINDEX_COUNT] = {
/* C: */
@@ -130,7 +130,7 @@ piano_roll_class_setup_skin (BstPianoRollClass *class)
{ 0, 0xca00, 0x2000, 0xcd00 }, /* pointer */
{ 0, 0x0000, 0x0000, 0xff00 }, /* select (blue) */
};
- GxkScrollCanvasClass *scroll_canvas_class = GXK_SCROLL_CANVAS_CLASS (class);
+ GxkScrollCanvasClass *scroll_canvas_class = GXK_SCROLL_CANVAS_CLASS (klass);
scroll_canvas_class->n_colors = G_N_ELEMENTS (colors);
scroll_canvas_class->colors = colors;
colors[CINDEX_HGRID] = gdk_color_from_rgb (BST_SKIN_CONFIG (piano_hgrid));
@@ -560,7 +560,7 @@ bst_piano_roll_draw_marker (GxkScrollCanvas *scc,
GxkScrollMarker *marker)
{
BstPianoRoll *self = BST_PIANO_ROLL (scc);
- BstPianoRollMarkerType mtype = marker->mtype;
+ BstPianoRollMarkerType mtype = BstPianoRollMarkerType (marker->mtype);
gint x = marker->extends.x, y = marker->extends.y, width = marker->extends.width, height = marker->extends.height;
GdkGC *draw_gc;
switch (mtype)
@@ -703,8 +703,8 @@ bst_piano_roll_draw_canvas (GxkScrollCanvas *scc,
GdkRectangle *area)
{
BstPianoRoll *self = BST_PIANO_ROLL (scc);
- GdkGC *light_gc, *dark_gc = STYLE (self)->dark_gc[GTK_STATE_NORMAL];
- gint pass, i, dlen, width, height, line_width = 0; /* line widths != 0 interfere with dash-settings on some X servers */
+ GdkGC *dark_gc = STYLE (self)->dark_gc[GTK_STATE_NORMAL];
+ gint pass, dlen, width, height, line_width = 0; /* line widths != 0 interfere with dash-settings on some X servers */
BsePartNoteSeq *pseq;
GXK_SCROLL_CANVAS_CLASS (bst_piano_roll_parent_class)->draw_canvas (scc, drawable, area);
gdk_window_get_size (drawable, &width, &height);
@@ -732,7 +732,7 @@ bst_piano_roll_draw_canvas (GxkScrollCanvas *scc,
for (pass = 1; pass <= 3; pass++)
{
/* draw vertical grid lines */
- for (i = area->x; i < area->x + area->width; i++)
+ for (int i = area->x; i < area->x + area->width; i++)
{
if (pass == 3 && coord_check_crossing (self, i, CROSSING_TACT))
{
@@ -746,7 +746,7 @@ bst_piano_roll_draw_canvas (GxkScrollCanvas *scc,
guint8 dash[3] = { 2, 2, 0 };
gdk_gc_set_line_attributes (draw_gc, line_width, GDK_LINE_ON_OFF_DASH, GDK_CAP_BUTT, GDK_JOIN_MITER);
dlen = dash[0] + dash[1];
- gdk_gc_set_dashes (draw_gc, (Y_OFFSET (self) + area->y + 1) % dlen, dash, 2);
+ gdk_gc_set_dashes (draw_gc, (Y_OFFSET (self) + area->y + 1) % dlen, (gint8*) dash, 2);
gdk_draw_line (drawable, draw_gc, i, area->y, i, area->y + area->height - 1);
gdk_gc_set_line_attributes (draw_gc, 0, GDK_LINE_SOLID, GDK_CAP_BUTT, GDK_JOIN_MITER);
}
@@ -756,13 +756,13 @@ bst_piano_roll_draw_canvas (GxkScrollCanvas *scc,
guint8 dash[3] = { 1, 1, 0 };
gdk_gc_set_line_attributes (draw_gc, line_width, GDK_LINE_ON_OFF_DASH, GDK_CAP_BUTT, GDK_JOIN_MITER);
dlen = dash[0] + dash[1];
- gdk_gc_set_dashes (draw_gc, (Y_OFFSET (self) + area->y + 1) % dlen, dash, 2);
+ gdk_gc_set_dashes (draw_gc, (Y_OFFSET (self) + area->y + 1) % dlen, (gint8*) dash, 2);
gdk_draw_line (drawable, draw_gc, i, area->y, i, area->y + area->height - 1);
gdk_gc_set_line_attributes (draw_gc, 0, GDK_LINE_SOLID, GDK_CAP_BUTT, GDK_JOIN_MITER);
}
}
/* draw horizontal grid lines */
- for (i = area->y; i < area->y + area->height; i++)
+ for (int i = area->y; i < area->y + area->height; i++)
{
NoteInfo info;
coord_to_note (self, i, &info);
@@ -781,7 +781,7 @@ bst_piano_roll_draw_canvas (GxkScrollCanvas *scc,
gdk_gc_set_line_attributes (draw_gc, line_width, GDK_LINE_ON_OFF_DASH, GDK_CAP_BUTT, GDK_JOIN_MITER);
dlen = dash[0] + dash[1];
- gdk_gc_set_dashes (draw_gc, (X_OFFSET (self) + area->x + 1) % dlen, dash, 2);
+ gdk_gc_set_dashes (draw_gc, (X_OFFSET (self) + area->x + 1) % dlen, (gint8*) dash, 2);
gdk_draw_line (drawable, draw_gc, area->x, i, area->x + area->width - 1, i);
gdk_gc_set_line_attributes (draw_gc, 0, GDK_LINE_SOLID, GDK_CAP_BUTT, GDK_JOIN_MITER);
}
@@ -792,7 +792,7 @@ bst_piano_roll_draw_canvas (GxkScrollCanvas *scc,
gdk_gc_set_line_attributes (draw_gc, line_width, GDK_LINE_ON_OFF_DASH, GDK_CAP_BUTT, GDK_JOIN_MITER);
dlen = dash[0] + dash[1];
- gdk_gc_set_dashes (draw_gc, (X_OFFSET (self) + area->x + 1) % dlen, dash, 2);
+ gdk_gc_set_dashes (draw_gc, (X_OFFSET (self) + area->x + 1) % dlen, (gint8*) dash, 2);
gdk_draw_line (drawable, draw_gc, area->x, i, area->x + area->width - 1, i);
gdk_gc_set_line_attributes (draw_gc, 0, GDK_LINE_SOLID, GDK_CAP_BUTT, GDK_JOIN_MITER);
}
@@ -800,12 +800,11 @@ bst_piano_roll_draw_canvas (GxkScrollCanvas *scc,
}
/* draw notes */
- light_gc = STYLE (self)->light_gc[GTK_STATE_NORMAL];
dark_gc = STYLE (self)->dark_gc[GTK_STATE_NORMAL];
pseq = self->proxy ? bse_part_list_notes_crossing (self->proxy,
coord_to_tick (self, area->x, FALSE),
coord_to_tick (self, area->x + area->width, FALSE)) : NULL;
- for (i = 0; pseq && i < pseq->n_pnotes; i++)
+ for (uint i = 0; pseq && i < pseq->n_pnotes; i++)
{
BsePartNote *pnote = pseq->pnotes[i];
gint semitone = SFI_NOTE_SEMITONE (pnote->note);
@@ -881,20 +880,20 @@ bst_piano_roll_draw_hpanel (GxkScrollCanvas *scc,
GdkGC *draw_gc = STYLE (self)->fg_gc[STATE (self)];
PangoRectangle rect = { 0 };
gchar buffer[64];
- gint i, width, height;
+ int width, height;
gdk_window_get_size (drawable, &width, &height);
bst_piano_roll_overlap_grow_hpanel_area (self, area);
/* draw tact/note numbers */
gdk_gc_set_clip_rectangle (draw_gc, area);
- for (i = area->x; i < area->x + area->width; i++)
+ for (int i = area->x; i < area->x + area->width; i++)
{
/* drawing qnote numbers is not of much use if we can't even draw
* the qnote quarter grid, so we special case draw_qqn_grid here
*/
if (coord_check_crossing (self, i, CROSSING_TACT))
{
- guint next_pixel, tact = coord_to_tick (self, i, TRUE) + 1;
+ int next_pixel, tact = coord_to_tick (self, i, TRUE) + 1;
tact /= (self->ppqn * self->qnpt);
next_pixel = tick_to_coord (self, (tact + 1) * (self->ppqn * self->qnpt));
@@ -911,7 +910,7 @@ bst_piano_roll_draw_hpanel (GxkScrollCanvas *scc,
}
else if (self->draw_qqn_grid && coord_check_crossing (self, i, CROSSING_QNOTE))
{
- guint next_pixel, tact = coord_to_tick (self, i, TRUE) + 1, qn = tact;
+ int next_pixel, tact = coord_to_tick (self, i, TRUE) + 1, qn = tact;
tact /= (self->ppqn * self->qnpt);
qn /= self->ppqn;
@@ -1167,7 +1166,7 @@ piano_roll_song_pointer_changed (BstPianoRoll *self,
if (plink)
bst_piano_roll_set_marker (self, 1, position - plink->tick, BST_PIANO_ROLL_MARKER_POINTER);
else
- bst_piano_roll_set_marker (self, 1, position, 0);
+ bst_piano_roll_set_marker (self, 1, position, BstPianoRollMarkerType (0));
}
static void
@@ -1311,8 +1310,8 @@ bst_piano_roll_set_view_selection (BstPianoRoll *self,
/* if at least one corner of the old an the new selection
* matches, it's probably worth updating only diff-regions
*/
- if ((tick == self->selection_tick ||
- tick + duration == self->selection_tick + self->selection_duration) &&
+ if ((tick == uint (self->selection_tick) ||
+ tick + duration == uint (self->selection_tick + self->selection_duration)) &&
(min_note == self->selection_min_note ||
max_note == self->selection_max_note))
{
@@ -1457,12 +1456,12 @@ bst_piano_roll_set_marker (BstPianoRoll *self,
}
static void
-bst_piano_roll_class_init (BstPianoRollClass *class)
+bst_piano_roll_class_init (BstPianoRollClass *klass)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (class);
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
- GxkScrollCanvasClass *scroll_canvas_class = GXK_SCROLL_CANVAS_CLASS (class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+ GxkScrollCanvasClass *scroll_canvas_class = GXK_SCROLL_CANVAS_CLASS (klass);
gobject_class->dispose = bst_piano_roll_dispose;
gobject_class->finalize = bst_piano_roll_finalize;
@@ -1483,28 +1482,28 @@ bst_piano_roll_class_init (BstPianoRollClass *class)
scroll_canvas_class->adjustment_changed = piano_roll_adjustment_changed;
scroll_canvas_class->handle_drag = piano_roll_handle_drag;
- bst_skin_config_add_notify ((BstSkinConfigNotify) piano_roll_class_setup_skin, class);
- piano_roll_class_setup_skin (class);
+ bst_skin_config_add_notify ((BstSkinConfigNotify) piano_roll_class_setup_skin, klass);
+ piano_roll_class_setup_skin (klass);
- class->canvas_clicked = NULL;
+ klass->canvas_clicked = NULL;
- signal_canvas_drag = g_signal_new ("canvas-drag", G_OBJECT_CLASS_TYPE (class),
+ signal_canvas_drag = g_signal_new ("canvas-drag", G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (BstPianoRollClass, canvas_drag),
NULL, NULL,
bst_marshal_NONE__POINTER,
G_TYPE_NONE, 1, G_TYPE_POINTER);
- signal_canvas_clicked = g_signal_new ("canvas-clicked", G_OBJECT_CLASS_TYPE (class),
+ signal_canvas_clicked = g_signal_new ("canvas-clicked", G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (BstPianoRollClass, canvas_clicked),
NULL, NULL,
bst_marshal_NONE__UINT_UINT_INT_BOXED,
G_TYPE_NONE, 4, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_INT,
GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
- signal_piano_drag = g_signal_new ("piano-drag", G_OBJECT_CLASS_TYPE (class),
+ signal_piano_drag = g_signal_new ("piano-drag", G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (BstPianoRollClass, piano_drag),
NULL, NULL,
bst_marshal_NONE__POINTER,
G_TYPE_NONE, 1, G_TYPE_POINTER);
- signal_piano_clicked = g_signal_new ("piano-clicked", G_OBJECT_CLASS_TYPE (class),
+ signal_piano_clicked = g_signal_new ("piano-clicked", G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (BstPianoRollClass, piano_clicked),
NULL, NULL,
bst_marshal_NONE__UINT_INT_BOXED,
diff --git a/beast-gtk/bstpianoroll.h b/beast-gtk/bstpianoroll.h
index c1875ee..28fc202 100644
--- a/beast-gtk/bstpianoroll.h
+++ b/beast-gtk/bstpianoroll.h
@@ -82,10 +82,10 @@ struct _BstPianoRoll
guint release_closes_toplevel : 1;
/* selection rectangle */
- guint selection_tick;
- guint selection_duration;
- gint selection_min_note;
- gint selection_max_note;
+ int selection_tick;
+ int selection_duration;
+ int selection_min_note;
+ int selection_max_note;
};
struct _BstPianoRollClass
{
diff --git a/beast-gtk/bstpianorollctrl.c b/beast-gtk/bstpianorollctrl.cc
similarity index 98%
rename from beast-gtk/bstpianorollctrl.c
rename to beast-gtk/bstpianorollctrl.cc
index 3fcc1ef..5b368b4 100644
--- a/beast-gtk/bstpianorollctrl.c
+++ b/beast-gtk/bstpianorollctrl.cc
@@ -167,7 +167,7 @@ bst_piano_roll_controller_get_clipboard (void)
static void
controller_reset_canvas_cursor (BstPianoRollController *self)
{
- controller_update_canvas_cursor (self, self->canvas_rtools->action_id);
+ controller_update_canvas_cursor (self, BstCommonRollTool (self->canvas_rtools->action_id));
}
BstPianoRollController*
@@ -547,14 +547,14 @@ check_hoverlap (SfiProxy part,
{
BsePartNoteSeq *pseq = bse_part_check_overlap (part, tick, duration, note);
BsePartNote *pnote;
-
+
if (pseq->n_pnotes == 0)
return FALSE; /* no overlap */
if (pseq->n_pnotes > 1)
return TRUE; /* definite overlap */
pnote = pseq->pnotes[0];
- if (pnote->tick == except_tick &&
- pnote->duration == except_duration)
+ if (uint (pnote->tick) == except_tick &&
+ uint (pnote->duration) == except_duration)
return FALSE; /* overlaps with exception */
}
return TRUE;
@@ -586,7 +586,7 @@ move_group_motion (BstPianoRollController *self,
BstPianoRollDrag *drag)
{
SfiProxy part = self->proll->proxy;
- gint i, new_tick, old_note, new_note, delta_tick, delta_note;
+ int new_tick, old_note, new_note, delta_tick, delta_note;
new_tick = MAX (drag->current_tick, self->xoffset) - self->xoffset;
new_tick = bst_piano_roll_controller_quantize (self, new_tick);
@@ -597,7 +597,7 @@ move_group_motion (BstPianoRollController *self,
delta_tick -= new_tick;
delta_note -= new_note;
bse_item_group_undo (part, "Move Selection");
- for (i = 0; i < self->sel_pseq->n_pnotes; i++)
+ for (uint i = 0; i < self->sel_pseq->n_pnotes; i++)
{
BsePartNote *pnote = self->sel_pseq->pnotes[i];
gint tick = pnote->tick;
@@ -623,8 +623,7 @@ move_motion (BstPianoRollController *self,
BstPianoRollDrag *drag)
{
SfiProxy part = self->proll->proxy;
- gint new_tick;
- gboolean note_changed;
+ bool note_changed;
if (self->sel_pseq)
{
@@ -632,10 +631,10 @@ move_motion (BstPianoRollController *self,
return;
}
- new_tick = MAX (drag->current_tick, self->xoffset) - self->xoffset;
+ int new_tick = MAX (drag->current_tick, self->xoffset) - self->xoffset;
new_tick = bst_piano_roll_controller_quantize (self, new_tick);
note_changed = self->obj_note != drag->current_note;
- if ((new_tick != self->obj_tick || note_changed) &&
+ if ((uint (new_tick) != self->obj_tick || note_changed) &&
!check_hoverlap (part, new_tick, self->obj_duration, drag->current_note,
self->obj_tick, note_changed ? 0 : self->obj_duration))
{
diff --git a/beast-gtk/bstplayback.c b/beast-gtk/bstplayback.cc
similarity index 99%
rename from beast-gtk/bstplayback.c
rename to beast-gtk/bstplayback.cc
index 170b9f7..775de4b 100644
--- a/beast-gtk/bstplayback.c
+++ b/beast-gtk/bstplayback.cc
@@ -134,7 +134,7 @@ wave_oscillator_pcm_notify (BstPlayBackHandle *handle,
static gboolean
pcm_timer (gpointer data)
{
- BstPlayBackHandle *handle = data;
+ BstPlayBackHandle *handle = (BstPlayBackHandle*) data;
GDK_THREADS_ENTER ();
if (!handle->waiting_for_notify)
diff --git a/beast-gtk/bstplaylist.c b/beast-gtk/bstplaylist.cc
similarity index 98%
rename from beast-gtk/bstplaylist.c
rename to beast-gtk/bstplaylist.cc
index 06d27bb..7291fbd 100644
--- a/beast-gtk/bstplaylist.c
+++ b/beast-gtk/bstplaylist.cc
@@ -60,8 +60,8 @@ container_remove (GtkWidget *widget)
gtk_container_remove (GTK_CONTAINER (widget->parent), widget);
}
-#include "bstdragpattern.c" /* draggable pattern widgets */
-#include "bstdraggroup.c" /* draggable pattern group widgets */
+#include "bstdragpattern.cc" /* draggable pattern widgets */
+#include "bstdraggroup.cc" /* draggable pattern group widgets */
/* --- prototypes --- */
static void bst_play_list_class_init (BstPlayListClass *klass);
@@ -126,14 +126,14 @@ bst_play_list_get_type (void)
}
static void
-bst_play_list_class_init (BstPlayListClass *class)
+bst_play_list_class_init (BstPlayListClass *klass)
{
GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
- object_class = GTK_OBJECT_CLASS (class);
- widget_class = GTK_WIDGET_CLASS (class);
- bst_play_list_class = class;
+ object_class = GTK_OBJECT_CLASS (klass);
+ widget_class = GTK_WIDGET_CLASS (klass);
+ bst_play_list_class = klass;
parent_class = gtk_type_class (GTK_TYPE_VPANED);
object_class->destroy = bst_play_list_destroy;
diff --git a/beast-gtk/bstpreferences.c b/beast-gtk/bstpreferences.cc
similarity index 88%
rename from beast-gtk/bstpreferences.c
rename to beast-gtk/bstpreferences.cc
index b19879e..77280e0 100644
--- a/beast-gtk/bstpreferences.c
+++ b/beast-gtk/bstpreferences.cc
@@ -34,9 +34,9 @@ static GtkWidget* bst_preferences_build_rec_editor (SfiRec *rec,
G_DEFINE_TYPE (BstPreferences, bst_preferences, GTK_TYPE_VBOX);
static void
-bst_preferences_class_init (BstPreferencesClass *class)
+bst_preferences_class_init (BstPreferencesClass *klass)
{
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
object_class->destroy = bst_preferences_destroy;
}
@@ -49,14 +49,14 @@ bst_preferences_init (BstPreferences *self)
GtkWidget *pchild;
SfiRec *rec;
- self->notebook = g_object_new (GXK_TYPE_NOTEBOOK,
- "visible", TRUE,
- "parent", self,
- "tab_pos", GTK_POS_TOP,
- "scrollable", FALSE,
- "can_focus", TRUE,
- "border_width", 5,
- NULL);
+ self->notebook = (GtkNotebook*) g_object_new (GXK_TYPE_NOTEBOOK,
+ "visible", TRUE,
+ "parent", self,
+ "tab_pos", GTK_POS_TOP,
+ "scrollable", FALSE,
+ "can_focus", TRUE,
+ "border_width", 5,
+ NULL);
gxk_nullify_in_object (self, &self->notebook);
pspec = bst_gconfig_pspec ();
@@ -142,7 +142,7 @@ bst_preferences_build_rec_editor (SfiRec *rec,
g_return_val_if_fail (rec != NULL, NULL);
- GtkWidget *vbox = g_object_new (GTK_TYPE_VBOX,
+ GtkWidget *vbox = (GtkWidget*) g_object_new (GTK_TYPE_VBOX,
"visible", TRUE,
"homogeneous", FALSE,
"border_width", 5,
@@ -158,7 +158,7 @@ bst_preferences_build_rec_editor (SfiRec *rec,
}
}
for (ring = params; ring; ring = sfi_ring_walk (ring, params))
- gxk_param_update (ring->data);
+ gxk_param_update ((GxkParam*) ring->data);
if (param_list)
*param_list = params;
else
@@ -172,11 +172,11 @@ bst_preferences_update_params (BstPreferences *self)
{
SfiRing *ring;
for (ring = self->params_gconfig; ring; ring = sfi_ring_walk (ring, self->params_gconfig))
- gxk_param_update (ring->data);
+ gxk_param_update ((GxkParam*) ring->data);
for (ring = self->params_skin; ring; ring = sfi_ring_walk (ring, self->params_skin))
- gxk_param_update (ring->data);
+ gxk_param_update ((GxkParam*) ring->data);
for (ring = self->bseparams; ring; ring = sfi_ring_walk (ring, self->bseparams))
- gxk_param_update (ring->data);
+ gxk_param_update ((GxkParam*) ring->data);
}
void
@@ -226,16 +226,17 @@ bst_preferences_default_revert (BstPreferences *self)
BstKeyBindingItemSeq *iseq;
BstKeyBinding *kbinding;
SfiRec *rec;
-
+
g_return_if_fail (BST_IS_PREFERENCES (self));
-
+
rec = sfi_rec_new ();
sfi_rec_validate (rec, sfi_pspec_get_rec_fields (bst_gconfig_pspec ()));
bst_gconfig_set_rec_rc_version (rec, BST_VERSION);
sfi_rec_swap_fields (self->rec_gconfig, rec);
sfi_rec_unref (rec);
-
+
kbinding = bst_pattern_controller_piano_keys();
+ (void) kbinding;
iseq = bst_key_binding_get_item_seq (bst_pattern_controller_default_piano_keys());
bst_key_binding_box_set (self->box_piano_keys, iseq);
bst_key_binding_item_seq_free (iseq);
@@ -328,7 +329,7 @@ bst_preferences_saved (void)
void
bst_preferences_save (BstPreferences *self)
{
- BseErrorType error = 0;
+ BseErrorType error = BseErrorType (0);
gchar *file_name;
GSList *slist = NULL;
@@ -373,11 +374,12 @@ bst_preferences_create_buttons (BstPreferences *self,
/* Apply
*/
- self->apply = g_object_connect (gxk_dialog_default_action (dialog, BST_STOCK_APPLY, NULL, NULL),
- "swapped_signal::clicked", bst_preferences_apply, self,
- "swapped_signal::clicked", bst_preferences_save, self,
- "swapped_signal::destroy", g_nullify_pointer, &self->apply,
- NULL);
+ self->apply = gxk_dialog_default_action (dialog, BST_STOCK_APPLY, NULL, NULL);
+ g_object_connect (self->apply,
+ "swapped_signal::clicked", bst_preferences_apply, self,
+ "swapped_signal::clicked", bst_preferences_save, self,
+ "swapped_signal::destroy", g_nullify_pointer, &self->apply,
+ NULL);
gxk_widget_set_tooltip (self->apply,
"Apply and save the preference values. Some values may only take effect after "
"restart while others can be locked against modifcation during "
@@ -385,16 +387,16 @@ bst_preferences_create_buttons (BstPreferences *self,
/* Revert
*/
- widget = gxk_dialog_action_swapped (dialog, BST_STOCK_REVERT, bst_preferences_revert, self);
+ widget = gxk_dialog_action_swapped (dialog, BST_STOCK_REVERT, (void*) bst_preferences_revert, self);
gxk_widget_set_tooltip (widget, "Revert dialog changes to the currently active values.");
/* Default Revert
*/
- widget = gxk_dialog_action_swapped (dialog, BST_STOCK_DEFAULT_REVERT, bst_preferences_default_revert, self);
+ widget = gxk_dialog_action_swapped (dialog, BST_STOCK_DEFAULT_REVERT, (void*) bst_preferences_default_revert, self);
gxk_widget_set_tooltip (widget, "Revert to hardcoded default values (factory settings).");
/* Close
*/
- widget = gxk_dialog_action (dialog, BST_STOCK_DISMISS, gxk_toplevel_delete, NULL);
+ widget = (GtkWidget*) gxk_dialog_action (dialog, BST_STOCK_DISMISS, (void*) gxk_toplevel_delete, NULL);
gxk_widget_set_tooltip (widget, "Discard changes and close dialog.");
}
diff --git a/beast-gtk/bstprocbrowser.c b/beast-gtk/bstprocbrowser.cc
similarity index 95%
rename from beast-gtk/bstprocbrowser.c
rename to beast-gtk/bstprocbrowser.cc
index 8096bff..7670c68 100644
--- a/beast-gtk/bstprocbrowser.c
+++ b/beast-gtk/bstprocbrowser.cc
@@ -28,7 +28,7 @@ enum {
};
/* --- prototypes --- */
-static void bst_proc_browser_class_init (BstProcBrowserClass *class);
+static void bst_proc_browser_class_init (BstProcBrowserClass *klass);
static void bst_proc_browser_init (BstProcBrowser *self);
static void bst_proc_browser_destroy (GtkObject *object);
static void proc_list_fill_value (BstProcBrowser *self,
@@ -74,11 +74,11 @@ bst_proc_browser_get_type (void)
}
static void
-bst_proc_browser_class_init (BstProcBrowserClass *class)
+bst_proc_browser_class_init (BstProcBrowserClass *klass)
{
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
- parent_class = g_type_class_peek_parent (class);
+ parent_class = g_type_class_peek_parent (klass);
object_class->destroy = bst_proc_browser_destroy;
}
@@ -210,7 +210,7 @@ tree_row_activated (BstProcBrowser *self,
GtkWidget*
bst_proc_browser_new (void)
{
- GtkWidget *sbrowser = g_object_new (BST_TYPE_PROC_BROWSER, NULL);
+ GtkWidget *sbrowser = (GtkWidget*) g_object_new (BST_TYPE_PROC_BROWSER, NULL);
return sbrowser;
}
diff --git a/beast-gtk/bstprocedure.c b/beast-gtk/bstprocedure.cc
similarity index 93%
rename from beast-gtk/bstprocedure.c
rename to beast-gtk/bstprocedure.cc
index 333bdc5..e410e0f 100644
--- a/beast-gtk/bstprocedure.c
+++ b/beast-gtk/bstprocedure.cc
@@ -44,7 +44,7 @@ bst_procedure_shell_get_type (void)
{
GtkTypeInfo procedure_shell_info =
{
- "BstProcedureShell",
+ (char*) "BstProcedureShell",
sizeof (BstProcedureShell),
sizeof (BstProcedureShellClass),
(GtkClassInitFunc) bst_procedure_shell_class_init,
@@ -61,12 +61,12 @@ bst_procedure_shell_get_type (void)
}
static void
-bst_procedure_shell_class_init (BstProcedureShellClass *class)
+bst_procedure_shell_class_init (BstProcedureShellClass *klass)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (class);
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
- parent_class = g_type_class_peek_parent (class);
+ parent_class = g_type_class_peek_parent (klass);
quark_output_params = g_quark_from_static_string ("Output Parameters");
quark_input_params = g_quark_from_static_string ("Input Parameters");
@@ -221,7 +221,7 @@ bst_procedure_shell_rebuild (BstProcedureShell *self)
pspecs = sfi_ring_append (pspecs, proc->ret_param);
for (ring = pspecs; ring; ring = sfi_ring_walk (ring, pspecs))
{
- GParamSpec *pspec = ring->data;
+ GParamSpec *pspec = (GParamSpec*) ring->data;
// gboolean is_out_param = pspec == proc->ret_param;
GxkParam *param = bst_param_new_rec (pspec, self->prec);
bst_param_create_gmask (param, NULL, param_box);
@@ -242,7 +242,7 @@ bst_procedure_shell_update (BstProcedureShell *self)
g_return_if_fail (BST_IS_PROCEDURE_SHELL (self));
for (ring = self->params; ring; ring = sfi_ring_walk (ring, self->params))
- gxk_param_update (ring->data);
+ gxk_param_update ((GxkParam*) ring->data);
}
static GxkParam*
@@ -251,8 +251,8 @@ shell_find_param (BstProcedureShell *self,
{
SfiRing *ring;
for (ring = self->params; ring; ring = sfi_ring_walk (ring, self->params))
- if (strcmp (name, gxk_param_get_name (ring->data)) == 0)
- return ring->data;
+ if (strcmp (name, gxk_param_get_name ((GxkParam*) ring->data)) == 0)
+ return (GxkParam*) ring->data;
return NULL;
}
@@ -271,12 +271,12 @@ bst_procedure_shell_execute (BstProcedureShell *self)
/* update parameter record */
for (ring = self->params; ring; ring = sfi_ring_walk (ring, self->params))
- gxk_param_apply_value (ring->data);
+ gxk_param_apply_value ((GxkParam*) ring->data);
if (widget)
{
SfiGlueProc *proc = self->proc;
- BseErrorType error = 0;
+ BseErrorType error = BseErrorType (0);
SfiSeq *pseq = sfi_seq_new ();
GValue *rvalue;
guint i;
@@ -317,7 +317,7 @@ bst_procedure_shell_reset (BstProcedureShell *self)
return;
for (ring = self->params; ring; ring = sfi_ring_walk (ring, self->params))
{
- GxkParam *param = ring->data;
+ GxkParam *param = (GxkParam*) ring->data;
GParamSpec *pspec = param->pspec;
gboolean is_out_param = pspec == proc->ret_param;
GValue value = { 0, };
@@ -346,7 +346,7 @@ bst_procedure_shell_unpreset (BstProcedureShell *self)
for (ring = self->params; ring; ring = sfi_ring_walk (ring, self->params))
{
- GxkParam *param = ring->data;
+ GxkParam *param = (GxkParam*) ring->data;
GParamSpec *pspec = param->pspec;
gboolean is_out_param = pspec == self->proc->ret_param;
if (!param->editable)
@@ -391,7 +391,7 @@ bst_procedure_shell_preset (BstProcedureShell *self,
for (ring = self->params; ring; ring = sfi_ring_walk (ring, self->params))
{
- GxkParam *param = ring->data;
+ GxkParam *param = (GxkParam*) ring->data;
GParamSpec *pspec = param->pspec;
gboolean is_out_param = pspec == proc->ret_param;
@@ -437,9 +437,9 @@ bst_procedure_shell_global (void)
global_proc_shell = (BstProcedureShell*) bst_procedure_shell_new (NULL);
g_object_ref (global_proc_shell);
gtk_object_sink (GTK_OBJECT (global_proc_shell));
- dialog = gxk_dialog_new (NULL, NULL,
- GXK_DIALOG_STATUS_BAR | GXK_DIALOG_HIDE_ON_DELETE | GXK_DIALOG_MODAL, // | GXK_DIALOG_WINDOW_GROUP,
- _("Start Procedure"), NULL);
+ dialog = (GtkWidget*) gxk_dialog_new (NULL, NULL,
+ GXK_DIALOG_STATUS_BAR | GXK_DIALOG_HIDE_ON_DELETE | GXK_DIALOG_MODAL, // | GXK_DIALOG_WINDOW_GROUP,
+ _("Start Procedure"), NULL);
gxk_dialog_set_sizes (GXK_DIALOG (dialog), -1, -1, 320, -1);
gtk_container_add (GTK_CONTAINER (GXK_DIALOG (dialog)->vbox), GTK_WIDGET (global_proc_shell));
@@ -447,8 +447,8 @@ bst_procedure_shell_global (void)
/* actions */
gxk_dialog_default_action_swapped (GXK_DIALOG (dialog),
- BST_STOCK_EXECUTE, bst_procedure_shell_execute, global_proc_shell);
- gxk_dialog_action (GXK_DIALOG (dialog), BST_STOCK_CLOSE, gxk_toplevel_delete, NULL);
+ BST_STOCK_EXECUTE, (void*) bst_procedure_shell_execute, global_proc_shell);
+ gxk_dialog_action (GXK_DIALOG (dialog), BST_STOCK_CLOSE, (void*) gxk_toplevel_delete, NULL);
}
return global_proc_shell;
}
diff --git a/beast-gtk/bstprofiler.c b/beast-gtk/bstprofiler.cc
similarity index 90%
rename from beast-gtk/bstprofiler.c
rename to beast-gtk/bstprofiler.cc
index 88b825c..2a7fbbe 100644
--- a/beast-gtk/bstprofiler.c
+++ b/beast-gtk/bstprofiler.cc
@@ -40,6 +40,7 @@ static BseThreadInfo *thread_infos = NULL;
/* --- funtions --- */
+#if 0
static gchar
char_state_from_thread_state (BseThreadState thread_state)
{
@@ -56,6 +57,7 @@ char_state_from_thread_state (BseThreadState thread_state)
case BSE_THREAD_STATE_DEAD: return SFI_THREAD_DEAD;
}
}
+#endif
static BseThreadState
thread_state_from_char_state (gchar thread_state)
@@ -134,7 +136,7 @@ update_infos (GSList *slist,
for (i = 0; i < n - 1; i++)
{
BseThreadInfo *oinfo = thread_infos + i;
- BseThreadInfo *ninfo = slist->data;
+ BseThreadInfo *ninfo = (BseThreadInfo*) slist->data;
slist = slist->next;
if (!oinfo->name || strcmp (oinfo->name, ninfo->name) ||
oinfo->thread_id != ninfo->thread_id ||
@@ -172,7 +174,7 @@ update_infos (GSList *slist,
static void
profiler_update (void)
{
- GxkListWrapper *lwrapper = g_object_get_data (profiler_dialog, "list-wrapper");
+ GxkListWrapper *lwrapper = (GxkListWrapper*) g_object_get_data ((GObject*) profiler_dialog, "list-wrapper");
BseThreadTotals *tt = bse_collect_thread_totals ();
sfi_thread_sleep (0); /* update accounting for self */
BirnetThreadInfo *si = sfi_thread_info_collect (sfi_thread_self());
@@ -219,10 +221,10 @@ bst_profiler_window_get (void)
if (!profiler)
{
profiler = gxk_radget_create ("beast", "profiler", NULL);
- profiler_dialog = gxk_dialog_new (&profiler, NULL,
- GXK_DIALOG_HIDE_ON_DELETE,
- _("Profiler"),
- profiler);
+ profiler_dialog = (GtkWidget*) gxk_dialog_new (&profiler, NULL,
+ GXK_DIALOG_HIDE_ON_DELETE,
+ _("Profiler"),
+ (GtkWidget*) profiler);
GxkListWrapper *lwrapper = gxk_list_wrapper_new (N_TCOLS,
G_TYPE_STRING, /* TCOL_NAME */
G_TYPE_STRING, /* TCOL_TID */
@@ -237,17 +239,17 @@ bst_profiler_window_get (void)
profiler, G_CONNECT_SWAPPED);
GtkTreeModel *smodel = gtk_tree_model_sort_new_with_model (GTK_TREE_MODEL (lwrapper));
g_object_unref (lwrapper);
- GtkTreeView *tview = gxk_radget_find (profiler, "tree-view");
+ GtkTreeView *tview = (GtkTreeView*) gxk_radget_find (profiler, "tree-view");
gtk_tree_view_set_model (tview, smodel);
GtkTreeSelection *tsel = gtk_tree_view_get_selection (tview);
gtk_tree_selection_set_mode (tsel, GTK_SELECTION_NONE);
g_object_unref (smodel);
- gxk_tree_view_add_text_column (tview, TCOL_NAME, "SAG", 0.0, _("Thread Name"), NULL, NULL, NULL, 0);
+ gxk_tree_view_add_text_column (tview, TCOL_NAME, "SAG", 0.0, _("Thread Name"), NULL, NULL, NULL, GConnectFlags (0));
if (BST_DVL_HINTS)
- gxk_tree_view_add_text_column (tview, TCOL_TID, "SA", 0.5, _("TID"), _("Thread ID (on some systems the process ID)"), NULL, NULL, 0);
- gxk_tree_view_add_text_column (tview, TCOL_PERC, "SAG", 1.0, _("CPU%"), _("Percentage of CPU usage"), NULL, NULL, 0);
- gxk_tree_view_add_text_column (tview, TCOL_UTIME, "SAG", 1.0, _("UTime"), _("Average number of milliseconds per second of user CPU time used by thread"), NULL, NULL, 0);
- gxk_tree_view_add_text_column (tview, TCOL_STIME, "SAG", 1.0, _("STime"), _("Average number of milliseconds per second of system CPU time used by thread"), NULL, NULL, 0);
+ gxk_tree_view_add_text_column (tview, TCOL_TID, "SA", 0.5, _("TID"), _("Thread ID (on some systems the process ID)"), NULL, NULL, GConnectFlags (0));
+ gxk_tree_view_add_text_column (tview, TCOL_PERC, "SAG", 1.0, _("CPU%"), _("Percentage of CPU usage"), NULL, NULL, GConnectFlags (0));
+ gxk_tree_view_add_text_column (tview, TCOL_UTIME, "SAG", 1.0, _("UTime"), _("Average number of milliseconds per second of user CPU time used by thread"), NULL, NULL, GConnectFlags (0));
+ gxk_tree_view_add_text_column (tview, TCOL_STIME, "SAG", 1.0, _("STime"), _("Average number of milliseconds per second of system CPU time used by thread"), NULL, NULL, GConnectFlags (0));
/*
gxk_tree_view_add_text_column (tview, TCOL_STATE, "F", 0.5, _("S"),
_("Thread State:\n"
@@ -261,9 +263,9 @@ bst_profiler_window_get (void)
"'X' - thread exited"),
NULL, NULL, 0);
*/
- gxk_tree_view_add_text_column (tview, TCOL_PRIO, "AG", 0.5, _("Nice"), _("Thread priority from -20 (high) to +19 (low)"), NULL, NULL, 0);
- gxk_tree_view_add_text_column (tview, TCOL_PROC, "A", 0.5, _("CPU#"), _("CPU the thread is currently running on"), NULL, NULL, 0);
- g_object_set_data (profiler_dialog, "list-wrapper", lwrapper);
+ gxk_tree_view_add_text_column (tview, TCOL_PRIO, "AG", 0.5, _("Nice"), _("Thread priority from -20 (high) to +19 (low)"), NULL, NULL, GConnectFlags (0));
+ gxk_tree_view_add_text_column (tview, TCOL_PROC, "A", 0.5, _("CPU#"), _("CPU the thread is currently running on"), NULL, NULL, GConnectFlags (0));
+ g_object_set_data ((GObject*) profiler_dialog, "list-wrapper", lwrapper);
profiler_update ();
}
if (!timer_id)
diff --git a/beast-gtk/bstprojectctrl.c b/beast-gtk/bstprojectctrl.cc
similarity index 72%
rename from beast-gtk/bstprojectctrl.c
rename to beast-gtk/bstprojectctrl.cc
index 831f8e9..ff28f2b 100644
--- a/beast-gtk/bstprojectctrl.c
+++ b/beast-gtk/bstprojectctrl.cc
@@ -36,7 +36,7 @@ bst_project_ctrl_play (BstProjectCtrl *self)
starting = _("Starting Playback");
bse_project_auto_deactivate (self->project, 0);
error = bse_project_play (self->project);
- bst_status_eprintf (error, starting);
+ bst_status_eprintf (error, "%s", starting);
}
}
@@ -119,17 +119,17 @@ bst_project_ctrl_init (BstProjectCtrl *self)
guint spaceing = 0;
/* Led */
- self->led = gxk_led_new (GXK_LED_OFF);
- frame = g_object_new (GTK_TYPE_FRAME,
- "shadow_type", GTK_SHADOW_ETCHED_OUT,
- "child", self->led,
- NULL);
+ self->led = (GxkLed*) gxk_led_new (GXK_LED_OFF);
+ frame = (GtkWidget*) g_object_new (GTK_TYPE_FRAME,
+ "shadow_type", GTK_SHADOW_ETCHED_OUT,
+ "child", self->led,
+ NULL);
gxk_led_set_border_width (self->led, 1);
gtk_box_pack_start (GTK_BOX (box), frame, FALSE, FALSE, spaceing);
gxk_nullify_in_object (self, &self->led);
/* Stop */
- self->stop = g_object_new (GTK_TYPE_BUTTON,
+ self->stop = (GtkWidget*) g_object_new (GTK_TYPE_BUTTON,
"child", gxk_polygon_new (&gxk_polygon_stop),
"can_focus", FALSE,
NULL);
@@ -141,38 +141,38 @@ bst_project_ctrl_init (BstProjectCtrl *self)
gxk_size_group (GTK_SIZE_GROUP_BOTH, frame, self->stop, NULL);
/* Rewind */
- self->rew = g_object_new (GTK_TYPE_BUTTON,
- "child", gxk_polygon_new (&gxk_polygon_rewind),
- "can_focus", FALSE,
- "sensitive", FALSE,
- NULL);
+ self->rew = (GtkWidget*) g_object_new (GTK_TYPE_BUTTON,
+ "child", gxk_polygon_new (&gxk_polygon_rewind),
+ "can_focus", FALSE,
+ "sensitive", FALSE,
+ NULL);
gtk_box_pack_start (GTK_BOX (box), self->rew, FALSE, FALSE, spaceing);
gxk_nullify_in_object (self, &self->rew);
/* Play */
- self->play = g_object_new (GTK_TYPE_BUTTON,
- "child", gxk_polygon_new (&gxk_polygon_play),
- "can_focus", FALSE,
- NULL);
+ self->play = (GtkWidget*) g_object_new (GTK_TYPE_BUTTON,
+ "child", gxk_polygon_new (&gxk_polygon_play),
+ "can_focus", FALSE,
+ NULL);
g_object_connect (self->play, "swapped_signal::clicked", bst_project_ctrl_play, self, NULL);
gtk_box_pack_start (GTK_BOX (box), self->play, FALSE, FALSE, spaceing);
gxk_nullify_in_object (self, &self->play);
/* Pause */
- self->pause = g_object_new (GTK_TYPE_BUTTON,
- "child", gxk_polygon_new (&gxk_polygon_pause),
- "can_focus", FALSE,
- "sensitive", FALSE,
- NULL);
+ self->pause = (GtkWidget*) g_object_new (GTK_TYPE_BUTTON,
+ "child", gxk_polygon_new (&gxk_polygon_pause),
+ "can_focus", FALSE,
+ "sensitive", FALSE,
+ NULL);
gtk_box_pack_start (GTK_BOX (box), self->pause, FALSE, FALSE, spaceing);
gxk_nullify_in_object (self, &self->pause);
/* Forward */
- self->fwd = g_object_new (GTK_TYPE_BUTTON,
- "child", gxk_polygon_new (&gxk_polygon_forward),
- "can_focus", FALSE,
- "sensitive", FALSE,
- NULL);
+ self->fwd = (GtkWidget*) g_object_new (GTK_TYPE_BUTTON,
+ "child", gxk_polygon_new (&gxk_polygon_forward),
+ "can_focus", FALSE,
+ "sensitive", FALSE,
+ NULL);
gtk_box_pack_start (GTK_BOX (box), self->fwd, FALSE, FALSE, spaceing);
gxk_nullify_in_object (self, &self->fwd);
@@ -181,9 +181,9 @@ bst_project_ctrl_init (BstProjectCtrl *self)
static void
-bst_project_ctrl_class_init (BstProjectCtrlClass *class)
+bst_project_ctrl_class_init (BstProjectCtrlClass *klass)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = bst_project_ctrl_finalize;
}
diff --git a/beast-gtk/bstqsampler.c b/beast-gtk/bstqsampler.cc
similarity index 98%
rename from beast-gtk/bstqsampler.c
rename to beast-gtk/bstqsampler.cc
index 008afbf..3988b7c 100644
--- a/beast-gtk/bstqsampler.c
+++ b/beast-gtk/bstqsampler.cc
@@ -76,11 +76,11 @@ static gint refresh_handler = 0;
G_DEFINE_TYPE (BstQSampler, bst_qsampler, GTK_TYPE_WIDGET);
static void
-bst_qsampler_class_init (BstQSamplerClass *class)
+bst_qsampler_class_init (BstQSamplerClass *klass)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (class);
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
gobject_class->finalize = bst_qsampler_finalize;
gobject_class->set_property = bst_qsampler_set_property;
@@ -302,12 +302,11 @@ bst_qsampler_get_bounds (BstQSampler *qsampler,
gint *first_offset,
gint *last_offset)
{
- GtkWidget *widget;
guint ostart, oend;
g_return_if_fail (BST_IS_QSAMPLER (qsampler));
- widget = GTK_WIDGET (qsampler);
+ // GtkWidget *widget = GTK_WIDGET (qsampler);
ostart = qsampler->peak_offset;
oend = ostart + qsampler->n_pixels - 1;
@@ -335,7 +334,7 @@ bst_qsampler_get_offset_at (BstQSampler *qsampler,
x_coord = *x_coord_p;
/* translate to peaks */
- fits_visible = x_coord >= 0 && x_coord < qsampler->n_pixels;
+ fits_visible = x_coord >= 0 && uint (x_coord) < qsampler->n_pixels;
/* translate to pcm offset */
x_coord += qsampler->peak_offset;
@@ -393,7 +392,7 @@ bst_qsampler_set_property (GObject *object,
bst_qsampler_set_vscale (qsampler, g_value_get_double (value));
break;
case PROP_DRAW_MODE:
- bst_qsampler_set_draw_mode (qsampler, g_value_get_enum (value));
+ bst_qsampler_set_draw_mode (qsampler, (BstQSamplerDrawMode) g_value_get_enum (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -567,7 +566,7 @@ bst_qsampler_refresh_idler (gpointer data)
GDK_THREADS_ENTER ();
for (slist = refresh_widgets; slist; slist = refresh_widgets)
{
- BstQSampler *qsampler = slist->data;
+ BstQSampler *qsampler = (BstQSampler*) slist->data;
refresh_widgets = slist->next;
slist->next = tmp_refresh_widgets;
@@ -579,7 +578,7 @@ bst_qsampler_refresh_idler (gpointer data)
tmp_refresh_widgets = NULL;
for (slist = refresh_widgets; slist; slist = refresh_widgets)
{
- BstQSampler *qsampler = slist->data;
+ BstQSampler *qsampler = (BstQSampler*) slist->data;
refresh_widgets = slist->next;
slist->next = tmp_refresh_widgets;
@@ -590,7 +589,7 @@ bst_qsampler_refresh_idler (gpointer data)
tmp_refresh_widgets = NULL;
for (slist = refresh_widgets; slist; slist = refresh_widgets)
{
- BstQSampler *qsampler = slist->data;
+ BstQSampler *qsampler = (BstQSampler*) slist->data;
refresh_widgets = slist->next;
if (qsampler->invalid_remains)
@@ -1345,9 +1344,8 @@ qsampler_esample_filler (gpointer data,
BstQSamplerPeak *values,
BstQSampler *qsampler)
{
- ESampleFiller *fill = data;
+ ESampleFiller *fill = (ESampleFiller*) data;
SfiFBlock *fblock;
- gint i;
voffset = voffset * fill->n_channels + fill->nth_channel;
fblock = bse_editable_sample_collect_stats (fill->esample,
@@ -1356,6 +1354,7 @@ qsampler_esample_filler (gpointer data,
block_size * fill->n_channels,
fill->n_channels,
n_values);
+ uint i;
for (i = 0; i < fblock->n_values / 2; i++)
{
values[i].min = fblock->values[i * 2] * 32767.9;
@@ -1368,7 +1367,7 @@ qsampler_esample_filler (gpointer data,
static void
free_esample_filler (gpointer data)
{
- ESampleFiller *fill = data;
+ ESampleFiller *fill = (ESampleFiller*) data;
bse_item_unuse (fill->esample);
g_free (data);
diff --git a/beast-gtk/bstqsampler.h b/beast-gtk/bstqsampler.h
index cd25278..e719b70 100644
--- a/beast-gtk/bstqsampler.h
+++ b/beast-gtk/bstqsampler.h
@@ -64,6 +64,14 @@ typedef enum
BST_QSAMPLER_NEEDS_DRAW = 1 << 6,
BST_QSAMPLER_DIRTY = 1 << 7
} BstQSamplerType;
+#ifdef __cplusplus
+inline BstQSamplerType operator& (BstQSamplerType s1, BstQSamplerType s2) { return BstQSamplerType (s1 & (long long unsigned) s2); }
+inline BstQSamplerType& operator&= (BstQSamplerType &s1, BstQSamplerType s2) { s1 = s1 & s2; return s1; }
+inline BstQSamplerType operator| (BstQSamplerType s1, BstQSamplerType s2) { return BstQSamplerType (s1 | (long long unsigned) s2); }
+inline BstQSamplerType& operator|= (BstQSamplerType &s1, BstQSamplerType s2) { s1 = s1 | s2; return s1; }
+inline BstQSamplerType operator~ (BstQSamplerType s1) { return BstQSamplerType (~(long long unsigned) s1); }
+#endif // __cplusplus
+
typedef enum
{
BST_QSAMPLER_DRAW_CRANGE,
diff --git a/beast-gtk/bstrackeditor-covers.c b/beast-gtk/bstrackeditor-covers.cc
similarity index 96%
rename from beast-gtk/bstrackeditor-covers.c
rename to beast-gtk/bstrackeditor-covers.cc
index 5260fd9..00848b0 100644
--- a/beast-gtk/bstrackeditor-covers.c
+++ b/beast-gtk/bstrackeditor-covers.cc
@@ -32,12 +32,12 @@ rack_cover_create (GtkWidget *rtable)
" #### ",
" ",
};
- GtkWidget *cover = g_object_new (GTK_TYPE_FRAME,
+ GtkWidget *cover = (GtkWidget*) g_object_new (GTK_TYPE_FRAME,
"visible", TRUE,
"shadow_type", GTK_SHADOW_ETCHED_OUT,
"border_width", 1,
NULL);
- GtkTable *table = g_object_new (GTK_TYPE_TABLE,
+ GtkTable *table = (GtkTable*) g_object_new (GTK_TYPE_TABLE,
"visible", TRUE,
"parent", cover,
NULL);
@@ -68,12 +68,13 @@ rack_cover_create (GtkWidget *rtable)
gdk_pixmap_unref (pixmap);
gdk_pixmap_unref (mask);
- pix = g_object_new (GTK_TYPE_ALIGNMENT, "visible", TRUE, NULL);
+ pix = (GtkWidget*) g_object_new (GTK_TYPE_ALIGNMENT, "visible", TRUE, NULL);
gtk_table_attach (table, pix, 1, 2, 1, 2, GTK_EXPAND, GTK_EXPAND, 0, 0);
return cover;
}
+#if 0
static void
rack_cover_grow_area_horizontal (BstRackTable *rtable,
guint col,
@@ -113,6 +114,7 @@ rack_cover_grow_area_vertical (BstRackTable *rtable,
*hspan = i;
*vspan = j;
}
+#endif
static GSList*
rack_cover_add_plates (BstRackTable *rtable)
diff --git a/beast-gtk/bstrackeditor.c b/beast-gtk/bstrackeditor.cc
similarity index 80%
rename from beast-gtk/bstrackeditor.c
rename to beast-gtk/bstrackeditor.cc
index 115a762..ef7b063 100644
--- a/beast-gtk/bstrackeditor.c
+++ b/beast-gtk/bstrackeditor.cc
@@ -21,7 +21,7 @@
/* --- include sources --- */
-#include "bstrackeditor-covers.c"
+#include "bstrackeditor-covers.cc"
/* --- prototypes --- */
@@ -60,20 +60,20 @@ bst_rack_editor_get_type (void)
type = g_type_register_static (GTK_TYPE_VBOX,
"BstRackEditor",
- &type_info, 0);
+ &type_info, GTypeFlags (0));
}
return type;
}
static void
-bst_rack_editor_class_init (BstRackEditorClass *class)
+bst_rack_editor_class_init (BstRackEditorClass *klass)
{
GtkObjectClass *object_class;
- object_class = GTK_OBJECT_CLASS (class);
+ object_class = GTK_OBJECT_CLASS (klass);
- parent_class = g_type_class_peek_parent (class);
+ parent_class = g_type_class_peek_parent (klass);
object_class->destroy = bst_rack_editor_destroy;
}
@@ -88,21 +88,20 @@ static void
bst_rack_editor_init (BstRackEditor *ed)
{
ed->pocket = 0;
-
- gtk_box_pack_start (GTK_BOX (ed),
- g_object_new (GTK_TYPE_LABEL,
- "label", _("The rack editor is still highly experimental code and guaranteed "
- "to be broken by future releases. So don't rely on rack editor contents "
- "to look similarly in future versions and be prepared to work around "
- "possible instabilities in the code (i.e. save your projects regularly)."),
- "visible", TRUE,
- "justify", GTK_JUSTIFY_CENTER,
- "wrap", TRUE,
- NULL),
- FALSE, FALSE, 3);
- ed->button_edit = g_object_new (GTK_TYPE_TOGGLE_BUTTON,
- "visible", TRUE,
- NULL);
+ GtkWidget *edchild =
+ (GtkWidget*) g_object_new (GTK_TYPE_LABEL,
+ "label", _("The rack editor is still highly experimental code and guaranteed "
+ "to be broken by future releases. So don't rely on rack editor contents "
+ "to look similarly in future versions and be prepared to work around "
+ "possible instabilities in the code (i.e. save your projects regularly)."),
+ "visible", TRUE,
+ "justify", GTK_JUSTIFY_CENTER,
+ "wrap", TRUE,
+ NULL);
+ gtk_box_pack_start (GTK_BOX (ed), edchild, FALSE, FALSE, 3);
+ ed->button_edit = (GtkWidget*) g_object_new (GTK_TYPE_TOGGLE_BUTTON,
+ "visible", TRUE,
+ NULL);
gtk_box_pack_start (GTK_BOX (ed), ed->button_edit, FALSE, TRUE, 0);
g_object_new (GTK_TYPE_LABEL,
"label", _("_Edit"),
@@ -115,10 +114,10 @@ bst_rack_editor_init (BstRackEditor *ed)
"swapped_signal::clicked", toggle_edit_mode, ed,
NULL);
- ed->rtable = g_object_new (BST_TYPE_RACK_TABLE,
- "visible", TRUE,
- "parent", ed,
- NULL);
+ ed->rtable = (BstRackTable*) g_object_new (BST_TYPE_RACK_TABLE,
+ "visible", TRUE,
+ "parent", ed,
+ NULL);
g_object_connect (ed->rtable,
"swapped_signal::destroy", g_nullify_pointer, &ed->rtable,
"swapped_signal::edit-mode-changed", update_covers, ed,
@@ -139,7 +138,7 @@ bst_rack_editor_destroy (GtkObject *object)
GSList *slist = ed->plate_list;
ed->plate_list = slist->next;
- gtk_widget_destroy (slist->data);
+ gtk_widget_destroy ((GtkWidget*) slist->data);
g_slist_free_1 (slist);
}
while (ed->item_list)
@@ -147,7 +146,7 @@ bst_rack_editor_destroy (GtkObject *object)
GSList *slist = ed->item_list;
ed->item_list = slist->next;
- gtk_widget_destroy (slist->data);
+ gtk_widget_destroy ((GtkWidget*) slist->data);
g_slist_free_1 (slist);
}
@@ -249,7 +248,7 @@ update_covers (BstRackEditor *ed)
GSList *slist = ed->plate_list;
ed->plate_list = slist->next;
- gtk_widget_destroy (slist->data);
+ gtk_widget_destroy ((GtkWidget*) slist->data);
g_slist_free_1 (slist);
}
}
@@ -268,7 +267,7 @@ update_items (BstRackEditor *ed)
GSList *slist = ed->item_list;
ed->item_list = slist->next;
- gtk_widget_destroy (slist->data);
+ gtk_widget_destroy ((GtkWidget*) slist->data);
g_slist_free_1 (slist);
}
@@ -297,7 +296,7 @@ create_rack_item (BstRackEditor *ed,
{
#if 0
gboolean edit_mode = ed->rtable->edit_mode;
- GtkWidget *item = g_object_new (BST_TYPE_RACK_ITEM,
+ GtkWidget *item = (GtkWidget*) g_object_new (BST_TYPE_RACK_ITEM,
"visible", TRUE,
NULL);
diff --git a/beast-gtk/bstrackitem.c b/beast-gtk/bstrackitem.cc
similarity index 94%
rename from beast-gtk/bstrackitem.c
rename to beast-gtk/bstrackitem.cc
index 5729862..cd78c85 100644
--- a/beast-gtk/bstrackitem.c
+++ b/beast-gtk/bstrackitem.cc
@@ -25,10 +25,6 @@ static void rack_item_init (BstRackItem *item);
static void rack_item_destroy (GtkObject *object);
static void rack_item_button_press (GxkRackItem *xitem,
GdkEventButton *event);
-static GtkWidget* create_controller_menu (void);
-static void sensitize_controller_menu (GtkWidget *menu,
- GParamSpec *pspec);
-static const gchar* controller_info_from_menu_id (guint id);
/* --- static variables --- */
@@ -53,18 +49,18 @@ bst_rack_item_get_type (void)
0, /* n_preallocs */
(GInstanceInitFunc) rack_item_init,
};
- type = g_type_register_static (GXK_TYPE_RACK_ITEM, "BstRackItem", &type_info, 0);
+ type = g_type_register_static (GXK_TYPE_RACK_ITEM, "BstRackItem", &type_info, GTypeFlags (0));
}
return type;
}
static void
-rack_item_class_init (BstRackItemClass *class)
+rack_item_class_init (BstRackItemClass *klass)
{
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
- GxkRackItemClass *xitem_class = GXK_RACK_ITEM_CLASS (class);
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
+ GxkRackItemClass *xitem_class = GXK_RACK_ITEM_CLASS (klass);
- parent_class = g_type_class_peek_parent (class);
+ parent_class = g_type_class_peek_parent (klass);
object_class->destroy = rack_item_destroy;
@@ -113,7 +109,7 @@ bst_rack_item_new (SfiProxy proxy,
g_print ("bst_rack_item_new: %p\n", rec);
if (!rec)
return NULL;
- self = g_object_new (BST_TYPE_RACK_ITEM, NULL);
+ self = (BstRackItem*) g_object_new (BST_TYPE_RACK_ITEM, NULL);
bst_rack_item_set_parasite (self, proxy, path);
return GTK_WIDGET (self);
}
diff --git a/beast-gtk/bstracktable.c b/beast-gtk/bstracktable.cc
similarity index 92%
rename from beast-gtk/bstracktable.c
rename to beast-gtk/bstracktable.cc
index 3f37ea9..1d20207 100644
--- a/beast-gtk/bstracktable.c
+++ b/beast-gtk/bstracktable.cc
@@ -107,21 +107,21 @@ bst_rack_table_get_type (void)
object_type = g_type_register_static (GTK_TYPE_TABLE,
"BstRackTable",
- &object_info, 0);
+ &object_info, GTypeFlags (0));
}
return object_type;
}
static void
-bst_rack_table_class_init (BstRackTableClass *class)
+bst_rack_table_class_init (BstRackTableClass *klass)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (class);
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
- GtkContainerClass *container_class = GTK_CONTAINER_CLASS (class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+ GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
- parent_class = g_type_class_peek_parent (class);
+ parent_class = g_type_class_peek_parent (klass);
quark_rack_info = g_quark_from_static_string ("BstRackChildInfo");
@@ -145,7 +145,7 @@ bst_rack_table_class_init (BstRackTableClass *class)
container_class->remove = bst_rack_table_remove;
signal_edit_mode_changed = g_signal_new ("edit-mode-changed",
- G_OBJECT_CLASS_TYPE (class),
+ G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (BstRackTableClass, edit_mode_changed),
NULL, NULL,
@@ -167,11 +167,11 @@ bst_rack_table_init (BstRackTable *rtable)
rtable->cell_request_width = 0;
rtable->cell_request_height = 0;
- rtable->drag_window = g_object_new (GTK_TYPE_WINDOW,
- "type", GTK_WINDOW_POPUP,
- "width_request", rtable->cell_request_width,
- "height_request", rtable->cell_request_height,
- NULL);
+ rtable->drag_window = (GtkWidget*) g_object_new (GTK_TYPE_WINDOW,
+ "type", GTK_WINDOW_POPUP,
+ "width_request", rtable->cell_request_width,
+ "height_request", rtable->cell_request_height,
+ NULL);
if (0)
g_object_new (GTK_TYPE_LABEL,
"parent", rtable->drag_window,
@@ -265,7 +265,7 @@ bst_rack_table_size_request (GtkWidget *widget,
for (list = table->children; list; list = list->next)
{
- GtkTableChild *child = list->data;
+ GtkTableChild *child = (GtkTableChild*) list->data;
if (GTK_WIDGET_VISIBLE (child->widget))
gtk_widget_size_request (child->widget, NULL);
@@ -359,15 +359,15 @@ bst_rack_table_button_press (GtkWidget *widget,
{
BstRackTable *rtable = BST_RACK_TABLE (widget);
GtkTable *table = GTK_TABLE (rtable);
-
+
if (!rtable->edit_mode)
return FALSE;
if (event->type == GDK_BUTTON_PRESS && event->button == 2)
{
- gboolean was_dragging = rtable->in_drag;
- guint h, v;
-
+ bool was_dragging = rtable->in_drag;
+ uint h, v;
+
if (bst_rack_table_iwindow_translate (rtable, event->x, event->y, &h, &v))
rtable->child = bst_rack_table_find_child (rtable, h, v);
rtable->in_drag = rtable->child != NULL;
@@ -390,15 +390,15 @@ bst_rack_table_button_press (GtkWidget *widget,
bst_rack_child_get_info (rtable->child, &rtable->drag_info);
rtable->xofs = event->x - GTK_CONTAINER (rtable)->border_width;
rtable->yofs = event->y - GTK_CONTAINER (rtable)->border_width;
- for (h = 0; h < rtable->drag_info.col; h++)
- rtable->xofs -= table->cols[h].allocation + table->cols[h].spacing;
- for (h = 0; h < rtable->drag_info.row; h++)
- rtable->yofs -= table->rows[h].allocation + table->rows[h].spacing;
+ for (int i = 0; i < rtable->drag_info.col; i++)
+ rtable->xofs -= table->cols[i].allocation + table->cols[i].spacing;
+ for (int i = 0; i < rtable->drag_info.row; i++)
+ rtable->yofs -= table->rows[i].allocation + table->rows[i].spacing;
widget_reparent (rtable->child, rtable->drag_window);
rtable->drag_col = rtable->drag_info.col;
rtable->drag_row = rtable->drag_info.row;
- h = table->cols[0].allocation + table->cols[0].spacing;
- v = table->rows[0].allocation + table->rows[0].spacing;
+ h = table->cols[0].allocation + table->cols[0].spacing;
+ v = table->rows[0].allocation + table->rows[0].spacing;
h *= rtable->drag_info.hspan - 1;
v *= rtable->drag_info.vspan - 1;
h += table->cols[0].allocation;
@@ -417,9 +417,8 @@ bst_rack_table_button_press (GtkWidget *widget,
}
else if (event->type == GDK_BUTTON_PRESS && event->button == 3 && !rtable->in_drag)
{
- GtkWidget *child = NULL;
- guint h, v;
-
+ uint h, v;
+ GtkWidget *child;
if (bst_rack_table_iwindow_translate (rtable, event->x, event->y, &h, &v))
child = bst_rack_table_find_child (rtable, h, v);
#if 0
@@ -429,6 +428,7 @@ bst_rack_table_button_press (GtkWidget *widget,
g_signal_emit_by_name (child, "button_press", event);
}
#endif
+ (void) child;
}
return TRUE;
@@ -447,7 +447,7 @@ bst_rack_table_motion_notify (GtkWidget *widget,
gint x, y;
gtk_window_move (GTK_WINDOW (rtable->drag_window), event->x_root - rtable->xofs, event->y_root - rtable->yofs);
-
+
if (event->is_hint) /* trigger new events */
gdk_window_get_pointer (widget->window, NULL, NULL, NULL);
@@ -466,7 +466,7 @@ bst_rack_table_motion_notify (GtkWidget *widget,
h = rtable->drag_col;
v = rtable->drag_row;
}
- if (h != rtable->drag_info.col || v != rtable->drag_info.row)
+ if (h != uint (rtable->drag_info.col) || v != uint (rtable->drag_info.row))
{
bst_rack_table_on_area (rtable, EXPOSE_AREA,
rtable->drag_info.col,
@@ -617,14 +617,14 @@ bst_rack_table_expose (GtkWidget *widget,
if (rtable->edit_mode)
{
- guint h1 = rtable->drag_info.col, h2 = h1 + rtable->drag_info.hspan;
- guint v1 = rtable->drag_info.row, v2 = v1 + rtable->drag_info.vspan;
- guint x = GTK_CONTAINER (rtable)->border_width + GTK_WIDGET (rtable)->allocation.x, bx = 0;
- guint i, j;
+ uint h1 = rtable->drag_info.col, h2 = h1 + rtable->drag_info.hspan;
+ uint v1 = rtable->drag_info.row, v2 = v1 + rtable->drag_info.vspan;
+ int x = GTK_CONTAINER (rtable)->border_width + GTK_WIDGET (rtable)->allocation.x, bx = 0;
+ uint i, j;
for (i = 0; i < table->ncols; i++)
{
- guint y = GTK_CONTAINER (rtable)->border_width + GTK_WIDGET (rtable)->allocation.y, by = 0;
+ int y = GTK_CONTAINER (rtable)->border_width + GTK_WIDGET (rtable)->allocation.y, by = 0;
bx = table->cols[i].allocation + table->cols[i].spacing;
if (x > event->area.x + event->area.width || x + bx < event->area.x)
@@ -667,7 +667,7 @@ bst_rack_table_add (GtkContainer *container,
{
BstRackTable *rtable = BST_RACK_TABLE (container);
GtkTable *table = GTK_TABLE (rtable);
- BstRackChildInfo rinfo;
+ BstRackChildInfo rinfo = { 0, };
bst_rack_child_get_info (child, &rinfo);
if (rinfo.hspan < 1)
@@ -733,7 +733,7 @@ bst_rack_table_iwindow_translate (BstRackTable *rtable,
*hcell = 0;
for (i = 0; i < table->ncols; i++)
{
- guint bound = table->cols[i].allocation + table->cols[i].spacing;
+ int bound = table->cols[i].allocation + table->cols[i].spacing;
if (x < bound)
{
@@ -749,7 +749,7 @@ bst_rack_table_iwindow_translate (BstRackTable *rtable,
*vcell = 0;
for (i = 0; i < table->nrows; i++)
{
- guint bound = table->rows[i].allocation + table->rows[i].spacing;
+ int bound = table->rows[i].allocation + table->rows[i].spacing;
if (y < bound)
{
@@ -774,7 +774,7 @@ bst_rack_table_find_child (BstRackTable *rtable,
for (list = table->children; list; list = list->next)
{
- GtkTableChild *child = list->data;
+ GtkTableChild *child = (GtkTableChild*) list->data;
if (hcell >= child->left_attach && hcell < child->right_attach &&
vcell >= child->top_attach && vcell < child->bottom_attach)
@@ -948,8 +948,6 @@ void
bst_rack_child_get_info (GtkWidget *widget,
BstRackChildInfo *info)
{
- BstRackChildInfo *rinfo;
-
g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (info != NULL);
@@ -958,7 +956,7 @@ bst_rack_child_get_info (GtkWidget *widget,
*info = BST_RACK_ITEM (widget)->rack_child_info;
else
{
- rinfo = g_object_get_qdata (G_OBJECT (widget), quark_rack_info);
+ BstRackChildInfo *rinfo = g_object_get_qdata (G_OBJECT (widget), quark_rack_info);
if (!rinfo)
{
info->col = -1;
@@ -979,9 +977,8 @@ bst_rack_child_set_info (GtkWidget *widget,
gint hspan,
gint vspan)
{
- BstRackChildInfo *rinfo;
GtkWidget *parent = NULL;
-
+
g_return_if_fail (GTK_IS_WIDGET (widget));
g_object_ref (widget);
@@ -992,6 +989,7 @@ bst_rack_child_set_info (GtkWidget *widget,
}
#if 0
+ BstRackChildInfo *rinfo;
if (BST_IS_RACK_ITEM (widget))
rinfo = &BST_RACK_ITEM (widget)->rack_child_info;
else
@@ -1007,11 +1005,11 @@ bst_rack_child_set_info (GtkWidget *widget,
rinfo->vspan = 1;
}
}
-#endif
rinfo->col = col >= 0 ? col : rinfo->col;
rinfo->row = row >= 0 ? row : rinfo->row;
rinfo->hspan = hspan > 1 ? hspan : rinfo->hspan;
rinfo->vspan = vspan > 1 ? vspan : rinfo->vspan;
+#endif
if (parent)
gtk_container_add (GTK_CONTAINER (parent), widget);
g_object_unref (widget);
diff --git a/beast-gtk/bstrackview.c b/beast-gtk/bstrackview.cc
similarity index 91%
rename from beast-gtk/bstrackview.c
rename to beast-gtk/bstrackview.cc
index 321db22..de91111 100644
--- a/beast-gtk/bstrackview.c
+++ b/beast-gtk/bstrackview.cc
@@ -16,7 +16,7 @@
*/
#include "bstrackview.h"
#include "bstrackitem.h"
-
+#include "gxk/gxkrackeditor.h"
/* --- prototypes --- */
static void rack_view_class_init (BstRackViewClass *klass);
@@ -70,18 +70,18 @@ bst_rack_view_get_type (void)
0, /* n_preallocs */
(GInstanceInitFunc) rack_view_init,
};
- type = g_type_register_static (GTK_TYPE_VBOX, "BstRackView", &type_info, 0);
+ type = g_type_register_static (GTK_TYPE_VBOX, "BstRackView", &type_info, GTypeFlags (0));
}
return type;
}
static void
-rack_view_class_init (BstRackViewClass *class)
+rack_view_class_init (BstRackViewClass *klass)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (class);
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
- parent_class = g_type_class_peek_parent (class);
+ parent_class = g_type_class_peek_parent (klass);
gobject_class->finalize = rack_view_finalize;
@@ -104,7 +104,7 @@ rack_view_init (BstRackView *self)
{
GxkRadget *radget = gxk_radget_complete (GTK_WIDGET (self), "beast", "rack-view", NULL);
GtkWidget *toggle;
- self->rack_table = gxk_radget_find (radget, "rack-table");
+ self->rack_table = (GxkRackTable*) gxk_radget_find (radget, "rack-table");
gtk_table_resize (GTK_TABLE (self->rack_table), 20, 80);
gxk_nullify_in_object (self, &self->rack_table);
g_object_connect (self->rack_table, "swapped_signal_after::button_press_event", rack_view_button_press_event, self, NULL);
@@ -112,7 +112,7 @@ rack_view_init (BstRackView *self)
"swapped_signal_after::button_press_event", rack_view_button_press_event, self, NULL);
self->item = 0;
gtk_widget_show (GTK_WIDGET (self));
- toggle = gxk_radget_find (radget, "edit-toggle");
+ toggle = (GtkWidget*) gxk_radget_find (radget, "edit-toggle");
g_object_connect (toggle, "signal::clicked", toggle_edit_mode, self, NULL);
/* publish popup menu actions */
gxk_widget_publish_actions (self, "rack-view-popup-actions",
@@ -143,7 +143,7 @@ rack_view_finalize (GObject *object)
GtkWidget*
bst_rack_view_new (SfiProxy item)
{
- GtkWidget *self = g_object_new (BST_TYPE_RACK_VIEW, NULL);
+ GtkWidget *self = (GtkWidget*) g_object_new (BST_TYPE_RACK_VIEW, NULL);
if (item)
{
g_return_val_if_fail (BSE_IS_ITEM (item), NULL);
@@ -208,7 +208,7 @@ bst_rack_view_rebuild (BstRackView *self)
g_return_if_fail (BST_IS_RACK_VIEW (self));
gtk_container_foreach (GTK_CONTAINER (self->rack_table), (GtkCallback) gtk_widget_destroy, NULL);
- toggle = gxk_radget_find (self, "edit-toggle");
+ toggle = (GtkWidget*) gxk_radget_find (self, "edit-toggle");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), FALSE);
if (!self->item)
return;
@@ -221,7 +221,7 @@ rack_view_button_press_event (BstRackView *self,
{
if (event->button == 3)
{
- gxk_menu_popup (gxk_radget_find (self, "rack-view-popup"),
+ gxk_menu_popup ((GtkMenu*) gxk_radget_find (self, "rack-view-popup"),
event->x_root, event->y_root,
event->button, event->time);
return TRUE;
@@ -238,7 +238,7 @@ rack_view_popup_action (gpointer user_data,
{
SfiRec *rec;
case ACTION_TOGGLE_EDIT:
- gtk_widget_activate (gxk_radget_find (self, "edit-toggle"));
+ gtk_widget_activate ((GtkWidget*) gxk_radget_find (self, "edit-toggle"));
break;
case ACTION_ADD_LABEL:
rec = sfi_rec_new ();
diff --git a/beast-gtk/bstrtest.c b/beast-gtk/bstrtest.cc
similarity index 98%
rename from beast-gtk/bstrtest.c
rename to beast-gtk/bstrtest.cc
index 5c4b24c..00a5df3 100644
--- a/beast-gtk/bstrtest.c
+++ b/beast-gtk/bstrtest.cc
@@ -34,12 +34,12 @@ make_cover (GtkWidget *rtable)
" #### ",
" ",
};
- GtkWidget *cover = g_object_new (GTK_TYPE_FRAME,
+ GtkWidget *cover = (GtkWidget*) g_object_new (GTK_TYPE_FRAME,
"visible", TRUE,
"shadow_type", GTK_SHADOW_ETCHED_OUT,
"border_width", 1,
NULL);
- GtkTable *table = g_object_new (GTK_TYPE_TABLE,
+ GtkTable *table = (GtkTable*) g_object_new (GTK_TYPE_TABLE,
"visible", TRUE,
"parent", cover,
NULL);
diff --git a/beast-gtk/bstsampleeditor.c b/beast-gtk/bstsampleeditor.cc
similarity index 87%
rename from beast-gtk/bstsampleeditor.c
rename to beast-gtk/bstsampleeditor.cc
index 366fb1b..8edafd7 100644
--- a/beast-gtk/bstsampleeditor.c
+++ b/beast-gtk/bstsampleeditor.cc
@@ -58,7 +58,7 @@ bst_sample_editor_get_type (void)
{
GtkTypeInfo sample_editor_info =
{
- "BstSampleEditor",
+ (char*) "BstSampleEditor",
sizeof (BstSampleEditor),
sizeof (BstSampleEditorClass),
(GtkClassInitFunc) bst_sample_editor_class_init,
@@ -75,13 +75,13 @@ bst_sample_editor_get_type (void)
}
static void
-bst_sample_editor_class_init (BstSampleEditorClass *class)
+bst_sample_editor_class_init (BstSampleEditorClass *klass)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (class);
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
- // GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
+ // GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- parent_class = g_type_class_peek_parent (class);
+ parent_class = g_type_class_peek_parent (klass);
gobject_class->set_property = bst_sample_editor_set_property;
gobject_class->get_property = bst_sample_editor_get_property;
@@ -336,7 +336,7 @@ change_draw_mode (BstSampleEditor *editor,
GtkOptionMenu *omenu)
{
guint i;
- guint mode = bst_choice_get_last (omenu->menu);
+ BstQSamplerDrawMode mode = (BstQSamplerDrawMode) bst_choice_get_last (omenu->menu);
for (i = 0; i < editor->n_channels; i++)
{
@@ -351,7 +351,7 @@ update_play_back_marks (gpointer data,
SfiNum tick_stamp,
guint pcm_pos)
{
- BstSampleEditor *editor = data;
+ BstSampleEditor *editor = (BstSampleEditor*) data;
guint i;
pcm_pos /= editor->n_channels;
@@ -359,7 +359,7 @@ update_play_back_marks (gpointer data,
{
BstQSampler *qsampler = editor->qsampler[i];
- bst_qsampler_set_mark (qsampler, 3, pcm_pos, 0);
+ bst_qsampler_set_mark (qsampler, 3, pcm_pos, BstQSamplerType (0));
bst_qsampler_force_refresh (qsampler);
bst_qsampler_scroll_rbounded (qsampler, pcm_pos, 0.98, 0.05);
bst_qsampler_set_mark (qsampler, 3, pcm_pos, BST_QSAMPLER_PRELIGHT);
@@ -434,7 +434,7 @@ bst_sample_editor_rebuild (BstSampleEditor *editor)
"border_width", 0,
"parent", qsampler_parent,
NULL);
- BstQSampler *qsampler = g_object_new (BST_TYPE_QSAMPLER,
+ BstQSampler *qsampler = (BstQSampler*) g_object_new (BST_TYPE_QSAMPLER,
"visible", TRUE,
"events", (GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK |
@@ -468,48 +468,46 @@ bst_sample_editor_rebuild (BstSampleEditor *editor)
"swapped_signal_after::value_changed", adjustments_changed, editor,
"swapped_signal::destroy", g_nullify_pointer, &editor->zoom_adjustment,
NULL);
- entry = g_object_new (GTK_TYPE_SPIN_BUTTON,
- "adjustment", editor->zoom_adjustment,
- "digits", 5,
- "visible", TRUE,
- NULL);
+ entry = (GtkWidget*) g_object_new (GTK_TYPE_SPIN_BUTTON,
+ "adjustment", editor->zoom_adjustment,
+ "digits", 5,
+ "visible", TRUE,
+ NULL);
gmask = bst_gmask_quick (mask_parent, 0, _("Zoom:"), entry, NULL);
editor->vscale_adjustment = GTK_ADJUSTMENT (gtk_adjustment_new (100, 1e-16, 1e+16, 1, 10, 0));
g_object_connect (editor->vscale_adjustment,
"swapped_signal_after::value_changed", adjustments_changed, editor,
"swapped_signal::destroy", g_nullify_pointer, &editor->vscale_adjustment,
NULL);
- entry = g_object_new (GTK_TYPE_SPIN_BUTTON,
- "adjustment", editor->vscale_adjustment,
- "digits", 5,
- "visible", TRUE,
- NULL);
+ entry = (GtkWidget*) g_object_new (GTK_TYPE_SPIN_BUTTON,
+ "adjustment", editor->vscale_adjustment,
+ "digits", 5,
+ "visible", TRUE,
+ NULL);
gmask = bst_gmask_quick (mask_parent, 1, _("VScale:"), entry, NULL);
-
-
+
/* setup qsampler selection start and end
*/
- editor->sstart = g_object_new (GTK_TYPE_ENTRY,
- "visible", TRUE,
- NULL);
+ editor->sstart = (GtkEntry*) g_object_new (GTK_TYPE_ENTRY,
+ "visible", TRUE,
+ NULL);
g_object_connect (editor->sstart,
"swapped_signal::destroy", g_nullify_pointer, &editor->sstart,
NULL);
gmask = bst_gmask_quick (mask_parent, 0, _("Start:"), editor->sstart, NULL);
- editor->send = g_object_new (GTK_TYPE_ENTRY,
- "visible", TRUE,
- NULL);
+ editor->send = (GtkEntry*) g_object_new (GTK_TYPE_ENTRY,
+ "visible", TRUE,
+ NULL);
g_object_connect (editor->send,
"swapped_signal::destroy", g_nullify_pointer, &editor->sstart,
NULL);
gmask = bst_gmask_quick (mask_parent, 1, _("End:"), editor->send, NULL);
-
-
+
/* setup sample display type
*/
- any = g_object_new (GTK_TYPE_OPTION_MENU,
- "visible", TRUE,
- NULL);
+ any = (GtkWidget*) g_object_new (GTK_TYPE_OPTION_MENU,
+ "visible", TRUE,
+ NULL);
gtk_option_menu_set_menu (GTK_OPTION_MENU (any),
bst_choice_menu_createv ("<BEAST-SampleEditor>/Popup",
BST_CHOICE (BST_QSAMPLER_DRAW_CRANGE, _("Shape Range"), NONE),
@@ -526,17 +524,16 @@ bst_sample_editor_rebuild (BstSampleEditor *editor)
NULL);
gtk_option_menu_set_history (GTK_OPTION_MENU (any), 0);
gmask = bst_gmask_quick (mask_parent, 2, NULL, any, NULL);
-
-
+
/* setup preview button
*/
- any = g_object_new (GTK_TYPE_BUTTON,
- "visible", TRUE,
- /* TRANSLATORS: here "Preview" is meant audible, i.e. to
- * playback the current sample version and listen to it.
- */
- "label", _("Preview"),
- NULL);
+ any = (GtkWidget*) g_object_new (GTK_TYPE_BUTTON,
+ "visible", TRUE,
+ /* TRANSLATORS: here "Preview" is meant audible, i.e. to
+ * playback the current sample version and listen to it.
+ */
+ "label", _("Preview"),
+ NULL);
g_object_connect (any,
"swapped_signal::clicked", play_back_wchunk, editor,
NULL);
diff --git a/beast-gtk/bstscrollgraph.c b/beast-gtk/bstscrollgraph.cc
similarity index 94%
rename from beast-gtk/bstscrollgraph.c
rename to beast-gtk/bstscrollgraph.cc
index 251e2a0..6c56b49 100644
--- a/beast-gtk/bstscrollgraph.c
+++ b/beast-gtk/bstscrollgraph.cc
@@ -370,7 +370,7 @@ bst_scrollgraph_expose (GtkWidget *widget,
if (event->region)
gdk_region_get_rectangles (event->region, &areas, &n_areas);
else
- areas = g_memdup (&event->area, sizeof (event->area));
+ areas = (GdkRectangle*) g_memdup (&event->area, sizeof (event->area));
for (j = 0; j < n_areas; j++)
{
const GdkRectangle *area = &areas[j];
@@ -544,11 +544,11 @@ bst_scrollgraph_init (BstScrollgraph *self)
}
static void
-bst_scrollgraph_class_init (BstScrollgraphClass *class)
+bst_scrollgraph_class_init (BstScrollgraphClass *klass)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (class);
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
gobject_class->set_property = bst_scrollgraph_set_property;
gobject_class->get_property = bst_scrollgraph_get_property;
@@ -565,7 +565,7 @@ bst_scrollgraph_class_init (BstScrollgraphClass *class)
widget_class->button_release_event = bst_scrollgraph_button_release;
widget_class->motion_notify_event = bst_scrollgraph_motion_notify;
- class->resize_values = scrollgraph_resize_values;
+ klass->resize_values = scrollgraph_resize_values;
bst_object_class_install_property (gobject_class, _("Spectrograph"), PROP_FLIP,
sfi_pspec_bool ("flip", _("Flip Spectrum"), _("Flip Spectrum display, interchaging low and high frequencies"),
@@ -579,7 +579,7 @@ bst_scrollgraph_class_init (BstScrollgraphClass *class)
bst_object_class_install_property (gobject_class, _("Spectrograph"), PROP_WINDOW_SIZE,
sfi_pspec_choice ("window_size", _("Window Size"), _("Adjust FFT window size"),
"BST_FFT_SIZE_512", bst_fft_size_get_values(), SFI_PARAM_STANDARD ":db-range"));
- signal_resize_values = g_signal_new ("resize-values", G_OBJECT_CLASS_TYPE (class),
+ signal_resize_values = g_signal_new ("resize-values", G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (BstScrollgraphClass, resize_values),
NULL, NULL,
bst_marshal_NONE__INT, // HACK: should use BstDirection enum type
@@ -601,8 +601,8 @@ scrollgraph_resize_rulers (BstScrollgraph *self,
gpointer data)
{
GtkWidget *widget = GTK_WIDGET (self);
- GtkWidget *hruler = g_object_get_data (self, "BstScrollgraph-hruler");
- GtkWidget *vruler = g_object_get_data (self, "BstScrollgraph-vruler");
+ GtkWidget *hruler = (GtkWidget*) g_object_get_data ((GObject*) self, "BstScrollgraph-hruler");
+ GtkWidget *vruler = (GtkWidget*) g_object_get_data ((GObject*) self, "BstScrollgraph-vruler");
if (self->source)
{
gdouble secs = self->window_size / (gdouble) self->mix_freq;
@@ -663,7 +663,7 @@ bst_scrollgraph_build_dialog (GtkWidget *alive_object,
g_return_val_if_fail (BSE_IS_SOURCE (source), NULL);
GxkRadget *radget = gxk_radget_create ("beast", "scrollgraph-dialog", NULL);
- BstScrollgraph *scg = gxk_radget_find (radget, "scrollgraph");
+ BstScrollgraph *scg = (BstScrollgraph*) gxk_radget_find (radget, "scrollgraph");
if (BST_IS_SCROLLGRAPH (scg))
{
if (!GTK_BIN (scg)->child)
@@ -674,26 +674,26 @@ bst_scrollgraph_build_dialog (GtkWidget *alive_object,
pbox = gxk_radget_find_area (pbox, NULL); /* find pbox' default child-area */
if (GTK_IS_CONTAINER (pbox))
{
- bst_param_create_span_gmask (scrollgraph_build_param (scg, "boost"), NULL, pbox, 2);
- bst_param_create_col_gmask (scrollgraph_build_param (scg, "window-size"), NULL, pbox, 0);
- bst_param_create_col_gmask (scrollgraph_build_param (scg, "direction"), NULL, pbox, 1);
- bst_param_create_col_gmask (scrollgraph_build_param (scg, "flip"), NULL, pbox, 2);
+ bst_param_create_span_gmask (scrollgraph_build_param (scg, "boost"), NULL, (GtkWidget*) pbox, 2);
+ bst_param_create_col_gmask (scrollgraph_build_param (scg, "window-size"), NULL, (GtkWidget*) pbox, 0);
+ bst_param_create_col_gmask (scrollgraph_build_param (scg, "direction"), NULL, (GtkWidget*) pbox, 1);
+ bst_param_create_col_gmask (scrollgraph_build_param (scg, "flip"), NULL, (GtkWidget*) pbox, 2);
}
- GtkWidget *hruler = gxk_radget_find (radget, "hruler");
- GtkWidget *vruler = gxk_radget_find (radget, "vruler");
+ GtkWidget *hruler = (GtkWidget*) gxk_radget_find (radget, "hruler");
+ GtkWidget *vruler = (GtkWidget*) gxk_radget_find (radget, "vruler");
if (hruler && vruler)
{
- g_object_set_data_full (scg, "BstScrollgraph-hruler", g_object_ref (hruler), g_object_unref);
- g_object_set_data_full (scg, "BstScrollgraph-vruler", g_object_ref (vruler), g_object_unref);
+ g_object_set_data_full ((GObject*) scg, "BstScrollgraph-hruler", g_object_ref (hruler), g_object_unref);
+ g_object_set_data_full ((GObject*) scg, "BstScrollgraph-vruler", g_object_ref (vruler), g_object_unref);
g_signal_connect_object (scg, "resize-values", G_CALLBACK (scrollgraph_resize_rulers), NULL, G_CONNECT_AFTER);
g_signal_connect_swapped (scg, "motion-notify-event", G_CALLBACK (GTK_WIDGET_GET_CLASS (hruler)->motion_notify_event), hruler); // HACK
g_signal_connect_swapped (scg, "motion-notify-event", G_CALLBACK (GTK_WIDGET_GET_CLASS (vruler)->motion_notify_event), vruler); // HACK
}
- GtkWidget *alignment = gxk_radget_find (radget, "scrollgraph-alignment");
+ GtkWidget *alignment = (GtkWidget*) gxk_radget_find (radget, "scrollgraph-alignment");
if (alignment)
g_signal_connect_object (scg, "resize-values", G_CALLBACK (scrollgraph_resize_alignment), alignment, G_CONNECT_AFTER);
}
- GtkWidget *dialog = gxk_dialog_new (NULL, (GtkObject*) alive_object, 0, "Scrollgraph", radget);
+ GtkWidget *dialog = (GtkWidget*) gxk_dialog_new (NULL, (GtkObject*) alive_object, GxkDialogFlags (0), "Scrollgraph", (GtkWidget*) radget);
gchar *title = g_strdup_printf ("Spectrogram: %%s (%s)", bse_source_ochannel_label (source, ochannel));
bst_window_sync_title_to_proxy (dialog, source, title);
g_free (title);
diff --git a/beast-gtk/bstsegment.c b/beast-gtk/bstsegment.cc
similarity index 98%
rename from beast-gtk/bstsegment.c
rename to beast-gtk/bstsegment.cc
index 40f9a5a..01668d3 100644
--- a/beast-gtk/bstsegment.c
+++ b/beast-gtk/bstsegment.cc
@@ -57,7 +57,7 @@ bst_segment_init (BstSegment *self,
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
self->type = type;
- self->any.drawable = g_object_ref (drawable);
+ self->any.drawable = (GdkDrawable*) g_object_ref (drawable);
switch (self->type)
{
case BST_SEGMENT_LINE:
diff --git a/beast-gtk/bstsequence.c b/beast-gtk/bstsequence.cc
similarity index 89%
rename from beast-gtk/bstsequence.c
rename to beast-gtk/bstsequence.cc
index 3a002dd..7da17d7 100644
--- a/beast-gtk/bstsequence.c
+++ b/beast-gtk/bstsequence.cc
@@ -42,10 +42,10 @@ static guint seq_changed_signal = 0;
G_DEFINE_TYPE (BstSequence, bst_sequence, GTK_TYPE_HBOX);
static void
-bst_sequence_class_init (BstSequenceClass *class)
+bst_sequence_class_init (BstSequenceClass *klass)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (class);
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
gobject_class->finalize = bst_sequence_finalize;
@@ -71,17 +71,17 @@ bst_sequence_init (BstSequence *seq)
"parent", seq,
NULL);
- seq->darea = g_object_new (GTK_TYPE_DRAWING_AREA,
- "visible", TRUE,
- "height_request", 50,
- "parent", frame,
- "events", (GDK_EXPOSURE_MASK |
- GDK_ENTER_NOTIFY_MASK |
- GDK_LEAVE_NOTIFY_MASK |
- GDK_BUTTON_PRESS_MASK |
- GDK_BUTTON_RELEASE_MASK |
- GDK_BUTTON1_MOTION_MASK),
- NULL);
+ seq->darea = (GtkWidget*) g_object_new (GTK_TYPE_DRAWING_AREA,
+ "visible", TRUE,
+ "height_request", 50,
+ "parent", frame,
+ "events", (GDK_EXPOSURE_MASK |
+ GDK_ENTER_NOTIFY_MASK |
+ GDK_LEAVE_NOTIFY_MASK |
+ GDK_BUTTON_PRESS_MASK |
+ GDK_BUTTON_RELEASE_MASK |
+ GDK_BUTTON1_MOTION_MASK),
+ NULL);
g_object_connect (seq->darea,
"swapped_signal::destroy", g_nullify_pointer, &seq->darea,
"swapped_object_signal::configure_event", darea_configure_event, seq,
diff --git a/beast-gtk/bstservermonitor.c b/beast-gtk/bstservermonitor.cc
similarity index 93%
rename from beast-gtk/bstservermonitor.c
rename to beast-gtk/bstservermonitor.cc
index 935aee8..18116fc 100644
--- a/beast-gtk/bstservermonitor.c
+++ b/beast-gtk/bstservermonitor.cc
@@ -18,7 +18,7 @@
/* --- prototypes --- */
-static void bst_server_monitor_class_init (BstServerMonitorClass *class);
+static void bst_server_monitor_class_init (BstServerMonitorClass *klass);
static void bst_server_monitor_init (BstServerMonitor *smon);
static void bst_server_monitor_finalize (GObject *object);
@@ -54,11 +54,11 @@ bst_server_monitor_get_type (void)
}
static void
-bst_server_monitor_class_init (BstServerMonitorClass *class)
+bst_server_monitor_class_init (BstServerMonitorClass *klass)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- parent_class = g_type_class_peek_parent (class);
+ parent_class = g_type_class_peek_parent (klass);
gobject_class->finalize = bst_server_monitor_finalize;
}
diff --git a/beast-gtk/bstskinconfig.c b/beast-gtk/bstskinconfig.cc
similarity index 96%
rename from beast-gtk/bstskinconfig.c
rename to beast-gtk/bstskinconfig.cc
index 7cd8f67..e34e8a7 100644
--- a/beast-gtk/bstskinconfig.c
+++ b/beast-gtk/bstskinconfig.cc
@@ -86,7 +86,7 @@ rec_make_absolute_pathnames (SfiRec *rec,
GValue *value = sfi_rec_get (rec, pspec->name);
if (value && G_VALUE_HOLDS_STRING (value))
{
- const gchar *str = g_value_get_string (value);
+ const gchar *str = (const gchar*) g_value_get_string (value);
if (str && strlen (str))
sfi_value_take_string (value, sfi_path_get_filename (str, path_prefix));
}
@@ -169,18 +169,20 @@ bst_skin_config_dirname (void)
return skin_path_prefix;
}
-static struct {
+struct SkinNotify {
BstSkinConfigNotify func;
gpointer data;
-} *notifies;
-static guint n_notifies = 0;
+};
+
+static SkinNotify *notifies = NULL;
+static uint n_notifies = 0;
void
bst_skin_config_add_notify (BstSkinConfigNotify func,
gpointer data)
{
- guint i = n_notifies++;
- notifies = g_realloc (notifies, sizeof (notifies[0]) * n_notifies);
+ uint i = n_notifies++;
+ notifies = (SkinNotify*) g_realloc (notifies, sizeof (notifies[0]) * n_notifies);
notifies[i].func = func;
notifies[i].data = data;
}
@@ -251,7 +253,7 @@ skin_file_try_statement (gpointer context_data,
GScanner *scanner,
gpointer user_data)
{
- gchar *absname = user_data;
+ const char *absname = (const char*) user_data;
g_assert (scanner->next_token == G_TOKEN_IDENTIFIER);
if (strcmp (bst_skin_config_pspec()->name, scanner->next_value.v_identifier) == 0)
{
diff --git a/beast-gtk/bstsnetrouter.c b/beast-gtk/bstsnetrouter.cc
similarity index 91%
rename from beast-gtk/bstsnetrouter.c
rename to beast-gtk/bstsnetrouter.cc
index acfb334..fd67d3e 100644
--- a/beast-gtk/bstsnetrouter.c
+++ b/beast-gtk/bstsnetrouter.cc
@@ -38,7 +38,7 @@ enum {
};
/* --- tools & actions --- */
-struct { gulong action_id; const gchar *blurb; } tool_blurbs[] = {
+struct ToolBlurb { size_t action_id; const char *blurb; } tool_blurbs[] = {
{ ROUTER_TOOL_EDIT, N_("Edit tool (mouse buttons 1-3)\n"
"Use button1 to create links, button2 "
"for movement and button3 to change properties"), },
@@ -110,11 +110,11 @@ bst_snet_router_destroy_contents (BstSNetRouter *self)
GnomeCanvasGroup *group = GNOME_CANVAS_GROUP (canvas->root);
while (group->item_list)
- gtk_object_destroy (group->item_list->data);
+ gtk_object_destroy ((GtkObject*) group->item_list->data);
}
while (self->canvas_links)
{
- BstCanvasLink *link = sfi_ring_pop_head (&self->canvas_links);
+ BstCanvasLink *link = (BstCanvasLink*) sfi_ring_pop_head (&self->canvas_links);
gtk_object_destroy (GTK_OBJECT (link));
g_object_unref (link);
}
@@ -160,7 +160,7 @@ bst_snet_router_update_links (BstSNetRouter *self,
self->canvas_links = NULL;
while (tmp_ring)
{
- BstCanvasLink *link = sfi_ring_pop_head (&tmp_ring);
+ BstCanvasLink *link = (BstCanvasLink*) sfi_ring_pop_head (&tmp_ring);
if (link->icsource == csource)
iring = sfi_ring_append (iring, link);
else
@@ -170,8 +170,7 @@ bst_snet_router_update_links (BstSNetRouter *self,
/* now we walk the (c)source's input channels, keep
* existing links and create new ones on the fly
*/
- guint i;
- for (i = 0; i < bse_source_n_ichannels (csource->source); i++)
+ for (int i = 0; i < bse_source_n_ichannels (csource->source); i++)
{
guint j, n_joints = bse_source_ichannel_get_n_joints (csource->source, i);
for (j = 0; j < n_joints; j++)
@@ -190,9 +189,9 @@ bst_snet_router_update_links (BstSNetRouter *self,
BstCanvasLink *link = NULL;
for (node = iring; node; node = sfi_ring_walk (node, iring))
{
- link = iring->data;
+ link = (BstCanvasLink*) iring->data;
if (link &&
- link->ichannel == i &&
+ link->ichannel == uint (i) &&
link->ocsource == ocsource &&
link->ochannel == ochannel)
break;
@@ -201,7 +200,7 @@ bst_snet_router_update_links (BstSNetRouter *self,
node->data = NULL;
else /* got none, ok, need to create new one */
{
- link = g_object_ref (bst_canvas_link_new (GNOME_CANVAS_GROUP (canvas->root)));
+ link = (BstCanvasLink*) g_object_ref (bst_canvas_link_new (GNOME_CANVAS_GROUP (canvas->root)));
bst_canvas_link_set_icsource (link, csource, i);
bst_canvas_link_set_ocsource (link, ocsource, ochannel);
/* queue update cause ellipse-rect is broken */
@@ -214,7 +213,7 @@ bst_snet_router_update_links (BstSNetRouter *self,
/* cleanup iring and left-over link objects */
while (iring)
{
- BstCanvasLink *link = sfi_ring_pop_head (&iring);
+ BstCanvasLink *link = (BstCanvasLink*) sfi_ring_pop_head (&iring);
if (link)
{
gtk_object_destroy (GTK_OBJECT (link));
@@ -231,7 +230,7 @@ bst_snet_router_handle_link_update (gpointer data)
GDK_THREADS_ENTER();
while (queued_canvas_sources)
{
- BstCanvasSource *csource = sfi_ring_pop_head (&queued_canvas_sources);
+ BstCanvasSource *csource = (BstCanvasSource*) sfi_ring_pop_head (&queued_canvas_sources);
GnomeCanvasItem *citem = GNOME_CANVAS_ITEM (csource);
GnomeCanvas *canvas = citem->canvas;
if (BST_IS_SNET_ROUTER (canvas))
@@ -324,7 +323,7 @@ bst_snet_router_set_snet (BstSNetRouter *self,
bst_snet_router_update (self);
bst_snet_router_adjust_region (self);
#if 0
- gfloat zoom;
+ float zoom;
if (bse_parasite_get_floats (self->snet, "BstRouterZoom", 1, &zoom) == 1)
gtk_adjustment_set_value (self->adjustment, zoom);
#endif
@@ -332,16 +331,14 @@ bst_snet_router_set_snet (BstSNetRouter *self,
}
static void
-bst_router_popup_select (gpointer user_data,
- gulong action_id)
+bst_router_popup_select (gpointer user_data, size_t action_id)
{
BstSNetRouter *self = BST_SNET_ROUTER (user_data);
gxk_action_group_select (self->canvas_tool, action_id);
}
static void
-bst_router_run_method (gpointer user_data,
- gulong action_id)
+bst_router_run_method (gpointer user_data, size_t action_id)
{
BstSNetRouter *self = BST_SNET_ROUTER (user_data);
BseCategory *cat = bse_category_from_id (action_id);
@@ -407,21 +404,18 @@ bst_snet_router_update (BstSNetRouter *self)
static gboolean
idle_zoom (gpointer data)
{
- GnomeCanvas *canvas;
- gdouble *d;
-
GDK_THREADS_ENTER ();
- canvas = GNOME_CANVAS (data);
- d = gtk_object_get_data (GTK_OBJECT (canvas), "zoom_d");
-
+ GnomeCanvas *canvas = GNOME_CANVAS (data);
+ double *d = (double*) gtk_object_get_data (GTK_OBJECT (canvas), "zoom_d");
+
if (EPSILON < fabs (canvas->pixels_per_unit - *d))
gnome_canvas_set_zoom (canvas, *d);
-
+
gtk_object_remove_data (GTK_OBJECT (canvas), "zoom_d");
GDK_THREADS_LEAVE ();
-
+
return FALSE;
}
@@ -429,7 +423,7 @@ static void
bst_snet_router_adjust_zoom (BstSNetRouter *router)
{
GtkObject *object = GTK_OBJECT (router);
- gdouble *d = gtk_object_get_data (object, "zoom_d");
+ double *d = (double*) gtk_object_get_data (object, "zoom_d");
if (router->snet)
{
@@ -505,7 +499,7 @@ bst_snet_router_csource_from_source (BstSNetRouter *router,
root = GNOME_CANVAS_GROUP (canvas->root);
for (list = root->item_list; list; list = list->next)
{
- BstCanvasSource *csource = list->data;
+ BstCanvasSource *csource = (BstCanvasSource*) list->data;
if (BST_IS_CANVAS_SOURCE (csource) && csource->source == source)
return csource;
@@ -598,7 +592,7 @@ bst_snet_router_root_event (BstSNetRouter *self,
ochannel = bst_canvas_source_ochannel_at (csource, event->button.x, event->button.y);
ichannel = bst_canvas_source_ichannel_at (csource, event->button.x, event->button.y);
}
- at_channel = ochannel != ~0 || ichannel != ~0;
+ at_channel = ochannel != ~uint (0) || ichannel != ~uint (0);
if (event->type == GDK_BUTTON_PRESS &&
event->button.button == 1 &&
@@ -606,7 +600,7 @@ bst_snet_router_root_event (BstSNetRouter *self,
{
g_return_val_if_fail (self->tmp_line == NULL, FALSE);
- self->drag_is_input = ichannel != ~0;
+ self->drag_is_input = ichannel != ~uint (0);
if (csource && at_channel && self->drag_is_input && /* ichannel in use */
!bst_canvas_source_ichannel_free (csource, ichannel))
gxk_status_set (GXK_STATUS_ERROR, _("Input channel in use"), NULL);
@@ -624,13 +618,12 @@ bst_snet_router_root_event (BstSNetRouter *self,
&gpoints->coords[1]);
gpoints->coords[2] = gpoints->coords[0] + 50;
gpoints->coords[3] = gpoints->coords[1] + 50;
- self->tmp_line = g_object_connect (gnome_canvas_item_new (GNOME_CANVAS_GROUP (canvas->root),
- GNOME_TYPE_CANVAS_LINE,
- "fill_color", "black",
- "points", gpoints,
- NULL),
- "swapped_signal::destroy", g_nullify_pointer, &self->tmp_line,
- NULL);
+ self->tmp_line = gnome_canvas_item_new (GNOME_CANVAS_GROUP (canvas->root),
+ GNOME_TYPE_CANVAS_LINE,
+ "fill_color", "black",
+ "points", gpoints,
+ NULL);
+ g_object_connect (self->tmp_line, "swapped_signal::destroy", g_nullify_pointer, &self->tmp_line, NULL);
gnome_canvas_points_free (gpoints);
self->world_x = event->button.x; /* event coords are world already */
self->world_y = event->button.y; /* event coords are world already */
@@ -688,16 +681,16 @@ bst_snet_router_root_event (BstSNetRouter *self,
bse_item_get_name (csource->source),
NULL);
/* create popup sumenu */
- guint i, has_inputs = 0, monitor_ids = 1000000;
+ uint has_inputs = 0, monitor_ids = 1000000;
choice = bst_choice_menu_createv ("<BEAST-SNetRouter>/ModuleChannelPopup", NULL);
- for (i = 0; i < bse_source_n_ochannels (csource->source); i++)
+ for (int i = 0; i < bse_source_n_ochannels (csource->source); i++)
{
gchar *name = g_strdup_printf ("%d: %s", i + 1, bse_source_ochannel_label (csource->source, i));
bst_choice_menu_add_choice_and_free (choice, BST_CHOICE (monitor_ids + i, name, NONE));
g_free (name);
}
/* create popup */
- for (i = 0; has_inputs == 0 && i < bse_source_n_ichannels (csource->source); i++)
+ for (int i = 0; has_inputs == 0 && i < bse_source_n_ichannels (csource->source); i++)
has_inputs += bse_source_ichannel_get_n_joints (csource->source, i);
choice = bst_choice_menu_createv ("<BEAST-SNetRouter>/ModulePopup",
BST_CHOICE_TITLE (source_name),
@@ -713,7 +706,7 @@ bst_snet_router_root_event (BstSNetRouter *self,
BST_CHOICE_S (1, _("Delete"), DELETE, csource->source != self->snet),
BST_CHOICE_END);
g_free (source_name);
- i = bst_choice_modal (choice, event->button.button, event->button.time);
+ int i = bst_choice_modal (choice, event->button.button, event->button.time);
switch (i)
{
GtkWidget *dialog;
@@ -874,7 +867,7 @@ bst_snet_router_button_press (GtkWidget *widget,
static void
snet_router_tool2text (BstSNetRouter *self)
{
- GtkLabel *label = gxk_radget_find (self->palette, "type-label");
+ GtkLabel *label = (GtkLabel*) gxk_radget_find (self->palette, "type-label");
BseCategory *cat = ROUTER_TOOL (self) ? bse_category_from_id (ROUTER_TOOL (self)) : 0;
const gchar *blurb = cat ? bse_type_blurb (cat->type) : NULL;
const gchar *authors = cat ? bse_type_authors (cat->type) : NULL;
@@ -927,11 +920,11 @@ snet_router_action_exec (gpointer user_data,
case ROUTER_TOOL_TOGGLE_PALETTE:
if (!self->palette)
{
- self->palette = gxk_dialog_new (&self->palette,
- GTK_OBJECT (self),
- GXK_DIALOG_HIDE_ON_DELETE,
- _("Palette"),
- gxk_radget_create ("beast", "snet-palette", NULL));
+ self->palette = (GtkWidget*) gxk_dialog_new (&self->palette,
+ GTK_OBJECT (self),
+ GXK_DIALOG_HIDE_ON_DELETE,
+ _("Palette"),
+ (GtkWidget*) gxk_radget_create ("beast", "snet-palette", NULL));
/* add actions to palette */
gxk_widget_republish_actions (self->palette, "router-util-actions", self);
gxk_widget_republish_actions (self->palette, "router-canvas-tools", self);
@@ -951,7 +944,7 @@ snet_router_action_exec (gpointer user_data,
case ROUTER_TOOL_CHANNEL_HINTS:
for (list = root->item_list; list; list = list->next)
{
- BstCanvasSource *csource = list->data;
+ BstCanvasSource *csource = (BstCanvasSource*) list->data;
if (BST_IS_CANVAS_SOURCE (csource))
bst_canvas_source_set_channel_hints (csource, CHANNEL_HINTS (self));
}
@@ -963,7 +956,7 @@ snet_router_action_exec (gpointer user_data,
BstSNetRouter*
bst_snet_router_build_page (SfiProxy snet)
{
- static gchar *zoom_xpm[] = {
+ static const char *zoom_xpm[] = {
"12 12 2 1", " c None", "# c #000000",
" ",
" #### #### ",
@@ -990,22 +983,21 @@ bst_snet_router_build_page (SfiProxy snet)
radget = gxk_radget_create ("beast", "snet-view", NULL);
/* router */
- self = g_object_new (BST_TYPE_SNET_ROUTER,
- "aa", BST_SNET_ANTI_ALIASED,
- "visible", TRUE,
- NULL);
+ self = (BstSNetRouter*) g_object_new (BST_TYPE_SNET_ROUTER,
+ "aa", BST_SNET_ANTI_ALIASED,
+ "visible", TRUE,
+ NULL);
bst_snet_router_set_snet (self, snet);
gxk_radget_add (radget, "zoomed-window", self);
- self->canvas_popup = gxk_radget_find (radget, "snet-popup");
+ self->canvas_popup = (GtkMenu*) gxk_radget_find (radget, "snet-popup");
/* setup zoomed window and its toggle pixmap */
- zoomed_window = gxk_radget_find (radget, "zoomed-window");
+ zoomed_window = (GtkWidget*) gxk_radget_find (radget, "zoomed-window");
g_object_connect (zoomed_window,
"swapped_signal::zoom", bst_snet_router_adjust_region, self,
"swapped_signal::zoom", gtk_false, NULL,
NULL);
- pixmap = gdk_pixmap_colormap_create_from_xpm_d (NULL, gtk_widget_get_colormap (zoomed_window),
- &mask, NULL, zoom_xpm);
+ pixmap = gdk_pixmap_colormap_create_from_xpm_d (NULL, gtk_widget_get_colormap (zoomed_window), &mask, NULL, (char**) zoom_xpm);
pix = gtk_pixmap_new (pixmap, mask);
gdk_pixmap_unref (pixmap);
gdk_pixmap_unref (mask);
@@ -1086,7 +1078,7 @@ bst_snet_router_init (BstSNetRouter *self)
toolbar_modules = gxk_action_list_create_grouped (self->canvas_tool);
cseq = bse_categories_match ("/Modules/*");
/* toolbar module types */
- static struct { gchar *type, *name, *tip; } toolbar_types[] = {
+ static struct { const char *type, *name, *tip; } toolbar_types[] = {
{ "BsePcmInput", N_("Input"), N_("PCM Input module") },
{ "BseStandardOsc", N_("Oscillator"), N_("Standard oscillator module") },
{ "BseSimpleADSR", N_("ADSR"), N_("ADSR Envelope Generator") },
@@ -1159,13 +1151,13 @@ bst_snet_router_init (BstSNetRouter *self)
}
static void
-bst_snet_router_class_init (BstSNetRouterClass *class)
+bst_snet_router_class_init (BstSNetRouterClass *klass)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (class);
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- bst_snet_router_class = class;
+ bst_snet_router_class = klass;
gobject_class->finalize = bst_snet_router_finalize;
object_class->destroy = bst_snet_router_destroy;
@@ -1173,6 +1165,6 @@ bst_snet_router_class_init (BstSNetRouterClass *class)
widget_class->event = bst_snet_router_event;
widget_class->button_press_event = bst_snet_router_button_press;
- class->popup_factory = gtk_item_factory_new (GTK_TYPE_MENU, "<BstSnetRouter>", NULL);
- gtk_accel_group_lock (class->popup_factory->accel_group);
+ klass->popup_factory = gtk_item_factory_new (GTK_TYPE_MENU, "<BstSnetRouter>", NULL);
+ gtk_accel_group_lock (klass->popup_factory->accel_group);
}
diff --git a/beast-gtk/bstsnifferscope.c b/beast-gtk/bstsnifferscope.cc
similarity index 97%
rename from beast-gtk/bstsnifferscope.c
rename to beast-gtk/bstsnifferscope.cc
index bcf7d13..bfbf8df 100644
--- a/beast-gtk/bstsnifferscope.c
+++ b/beast-gtk/bstsnifferscope.cc
@@ -38,7 +38,7 @@ bst_sniffer_scope_init (BstSnifferScope *self)
GtkWidget*
bst_sniffer_scope_new (void)
{
- BstSnifferScope *self = g_object_new (BST_TYPE_SNIFFER_SCOPE, NULL);
+ BstSnifferScope *self = (BstSnifferScope*) g_object_new (BST_TYPE_SNIFFER_SCOPE, NULL);
return GTK_WIDGET (self);
}
@@ -257,11 +257,11 @@ scope_probes_notify (SfiProxy proxy,
}
static void
-bst_sniffer_scope_class_init (BstSnifferScopeClass *class)
+bst_sniffer_scope_class_init (BstSnifferScopeClass *klass)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (class);
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
gobject_class->finalize = bst_sniffer_scope_finalize;
diff --git a/beast-gtk/bstsplash.c b/beast-gtk/bstsplash.cc
similarity index 81%
rename from beast-gtk/bstsplash.c
rename to beast-gtk/bstsplash.cc
index cb69226..30426c4 100644
--- a/beast-gtk/bstsplash.c
+++ b/beast-gtk/bstsplash.cc
@@ -21,7 +21,7 @@
/* --- prototypes --- */
-static void bst_splash_class_init (BstSplashClass *class);
+static void bst_splash_class_init (BstSplashClass *klass);
static void bst_splash_init (BstSplash *splash);
static void bst_splash_finalize (GObject *object);
static gint bst_splash_button_press (GtkWidget *widget,
@@ -49,7 +49,7 @@ bst_splash_get_type (void)
{
GtkTypeInfo splash_info =
{
- "BstSplash",
+ (char*) "BstSplash",
sizeof (BstSplash),
sizeof (BstSplashClass),
(GtkClassInitFunc) bst_splash_class_init,
@@ -66,12 +66,12 @@ bst_splash_get_type (void)
}
static void
-bst_splash_class_init (BstSplashClass *class)
+bst_splash_class_init (BstSplashClass *klass)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (class);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- parent_class = g_type_class_peek_parent (class);
+ parent_class = g_type_class_peek_parent (klass);
gobject_class->finalize = bst_splash_finalize;
@@ -96,55 +96,55 @@ bst_splash_init (BstSplash *self)
NULL);
/* main vbox */
- self->vbox = g_object_new (GTK_TYPE_VBOX,
- "visible", TRUE,
- "spacing", 0,
- "parent", window,
- NULL);
+ self->vbox = (GtkWidget*) g_object_new (GTK_TYPE_VBOX,
+ "visible", TRUE,
+ "spacing", 0,
+ "parent", window,
+ NULL);
gxk_nullify_in_object (self, &self->vbox);
/* splash vbox */
- self->splash_box = g_object_new (GTK_TYPE_VBOX,
- "visible", TRUE,
- "spacing", 0,
- NULL);
+ self->splash_box = (GtkWidget*) g_object_new (GTK_TYPE_VBOX,
+ "visible", TRUE,
+ "spacing", 0,
+ NULL);
gxk_nullify_in_object (self, &self->splash_box);
gtk_box_pack_start (GTK_BOX (self->vbox), self->splash_box, TRUE, TRUE, 0);
/* progress bar */
- self->pbar = g_object_new (GTK_TYPE_PROGRESS_BAR,
- "visible", TRUE,
- NULL);
+ self->pbar = (GtkProgressBar*) g_object_new (GTK_TYPE_PROGRESS_BAR,
+ "visible", TRUE,
+ NULL);
gxk_nullify_in_object (self, &self->pbar);
gtk_box_pack_end (GTK_BOX (self->vbox), GTK_WIDGET (self->pbar), FALSE, TRUE, 0);
gtk_progress_set_show_text (GTK_PROGRESS (self->pbar), FALSE);
/* item label */
- any = g_object_new (GTK_TYPE_ALIGNMENT,
- "visible", TRUE,
- "xscale", 1.0,
- NULL);
+ any = (GtkWidget*) g_object_new (GTK_TYPE_ALIGNMENT,
+ "visible", TRUE,
+ "xscale", 1.0,
+ NULL);
gtk_box_pack_end (GTK_BOX (self->vbox), any, FALSE, TRUE, 3);
- self->item = g_object_new (GTK_TYPE_LABEL,
- "visible", TRUE,
- "label", "Item", /* untranslated template name */
- "width_request", 1,
- "parent", any,
- NULL);
+ self->item = (GtkWidget*) g_object_new (GTK_TYPE_LABEL,
+ "visible", TRUE,
+ "label", "Item", /* untranslated template name */
+ "width_request", 1,
+ "parent", any,
+ NULL);
gxk_nullify_in_object (self, &self->item);
/* entity label */
- any = g_object_new (GTK_TYPE_ALIGNMENT,
- "visible", TRUE,
- "xscale", 1.0,
- NULL);
+ any = (GtkWidget*) g_object_new (GTK_TYPE_ALIGNMENT,
+ "visible", TRUE,
+ "xscale", 1.0,
+ NULL);
gtk_box_pack_end (GTK_BOX (self->vbox), any, FALSE, TRUE, 5);
- self->entity = g_object_new (GTK_TYPE_LABEL,
- "visible", TRUE,
- "label", "Entity", /* untranslated template name */
- "width_request", 1,
- "parent", any,
- NULL);
+ self->entity = (GtkWidget*) g_object_new (GTK_TYPE_LABEL,
+ "visible", TRUE,
+ "label", "Entity", /* untranslated template name */
+ "width_request", 1,
+ "parent", any,
+ NULL);
gxk_nullify_in_object (self, &self->entity);
}
@@ -237,7 +237,7 @@ bst_splash_new (const gchar *role,
guint splash_height,
guint max_items)
{
- GtkWidget *splash = g_object_new (BST_TYPE_SPLASH, NULL);
+ GtkWidget *splash = (GtkWidget*) g_object_new (BST_TYPE_SPLASH, NULL);
/* set title and role */
gtk_window_set_role (GTK_WINDOW (splash), role);
@@ -371,11 +371,11 @@ bst_splash_set_text (GtkWidget *widget,
gchar *p = strchr (str, '\n');
if (p)
*p++ = 0;
- label = g_object_new (GTK_TYPE_LABEL,
- "visible", TRUE,
- "use_markup", TRUE,
- "label", str,
- NULL);
+ label = (GtkWidget*) g_object_new (GTK_TYPE_LABEL,
+ "visible", TRUE,
+ "use_markup", TRUE,
+ "label", str,
+ NULL);
gtk_box_pack_start (GTK_BOX (self->splash_box), label, TRUE, TRUE, 0);
str = p;
}
@@ -397,7 +397,7 @@ bst_splash_set_animation (GtkWidget *widget,
gtk_container_foreach (GTK_CONTAINER (self->splash_box), (GtkCallback) gtk_widget_destroy, NULL);
if (anim)
{
- GtkWidget *image = g_object_new (GTK_TYPE_IMAGE,
+ GtkWidget *image = (GtkWidget*) g_object_new (GTK_TYPE_IMAGE,
"visible", TRUE,
"parent",
g_object_new (GTK_TYPE_FRAME,
@@ -440,7 +440,7 @@ splash_select_string (BstSplash *self)
static gboolean
about_timer (gpointer data)
{
- BstSplash *self = data;
+ BstSplash *self = (BstSplash*) data;
float delta = 0.02;
GDK_THREADS_ENTER ();
self->aprogress += delta;
diff --git a/beast-gtk/bststest.c b/beast-gtk/bststest.cc
similarity index 100%
rename from beast-gtk/bststest.c
rename to beast-gtk/bststest.cc
diff --git a/beast-gtk/bstsupershell.c b/beast-gtk/bstsupershell.cc
similarity index 96%
rename from beast-gtk/bstsupershell.c
rename to beast-gtk/bstsupershell.cc
index 2781b0c..06cf335 100644
--- a/beast-gtk/bstsupershell.c
+++ b/beast-gtk/bstsupershell.cc
@@ -54,12 +54,12 @@ static BstSuperShellClass *bst_super_shell_class = NULL;
G_DEFINE_TYPE (BstSuperShell, bst_super_shell, GTK_TYPE_VBOX);
static void
-bst_super_shell_class_init (BstSuperShellClass *class)
+bst_super_shell_class_init (BstSuperShellClass *klass)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (class);
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
- bst_super_shell_class = class;
+ bst_super_shell_class = klass;
gobject_class->set_property = bst_super_shell_set_property;
gobject_class->get_property = bst_super_shell_get_property;
@@ -238,7 +238,7 @@ super_shell_build_wave_repo (BstSuperShell *self,
static GtkNotebook*
create_notebook (BstSuperShell *self)
{
- GtkNotebook *notebook = g_object_new (GXK_TYPE_NOTEBOOK,
+ GtkNotebook *notebook = (GtkNotebook*) g_object_new (GXK_TYPE_NOTEBOOK,
"scrollable", FALSE,
"tab_border", 0,
"show_border", TRUE,
diff --git a/beast-gtk/bsttrackroll.c b/beast-gtk/bsttrackroll.cc
similarity index 96%
rename from beast-gtk/bsttrackroll.c
rename to beast-gtk/bsttrackroll.cc
index 332d9b3..c3c3061 100644
--- a/beast-gtk/bsttrackroll.c
+++ b/beast-gtk/bsttrackroll.cc
@@ -22,7 +22,7 @@
/* --- defines --- */
/* accessors */
#define STYLE(self) (GTK_WIDGET (self)->style)
-#define STATE(self) (GTK_WIDGET (self)->state)
+#define STATE(WID) (GtkStateType (GTK_WIDGET (WID)->state))
#define SELECTED_STATE(self) (GTK_WIDGET_IS_SENSITIVE (self) ? GTK_STATE_SELECTED : GTK_STATE_INSENSITIVE)
#define ACTIVE_STATE(self) (GTK_WIDGET_IS_SENSITIVE (self) ? GTK_STATE_ACTIVE : GTK_STATE_INSENSITIVE)
#define XTHICKNESS(self) (STYLE (self)->xthickness)
@@ -202,7 +202,7 @@ bst_track_roll_setup (BstTrackRoll *self,
if (self->tree)
{
- g_object_disconnect_any (self->tree, gxk_scroll_canvas_reallocate, self);
+ g_object_disconnect_any (self->tree, (void*) gxk_scroll_canvas_reallocate, self);
g_object_unref (self->tree);
}
self->tree = tree;
@@ -493,7 +493,7 @@ track_roll_idle_update_scopes (gpointer data)
break;
for (slist = scope_list; slist; slist = slist->next)
{
- scope = slist->data;
+ scope = (GtkWidget*) slist->data;
if (scope_get_track (scope) == track) /* match existing */
{
scope_list = g_slist_remove (scope_list, scope);
@@ -502,7 +502,7 @@ track_roll_idle_update_scopes (gpointer data)
}
if (!slist) /* create new if not matched */
{
- scope = g_object_new (BST_TYPE_SNIFFER_SCOPE, NULL);
+ scope = (GtkWidget*) g_object_new (BST_TYPE_SNIFFER_SCOPE, NULL);
gtk_widget_show (scope);
scope_set_track (scope, track);
gtk_widget_set_parent_window (scope, VPANEL (self));
@@ -517,7 +517,7 @@ track_roll_idle_update_scopes (gpointer data)
/* get rid of unneeded scopes */
while (scope_list)
{
- GtkWidget *child = g_slist_pop_head (&scope_list);
+ GtkWidget *child = (GtkWidget*) g_slist_pop_head (&scope_list);
gtk_widget_unparent (child);
}
@@ -604,7 +604,7 @@ bst_track_roll_draw_canvas (GxkScrollCanvas *scc,
GdkGC *bgp_gc = widget->style->bg_gc[GTK_STATE_PRELIGHT];
GdkGC *dark_gc = widget->style->dark_gc[widget->state];
GdkGC *light_gc = widget->style->light_gc[widget->state];
- gint row = coord_to_row (self, area->y, NULL);
+ uint row = coord_to_row (self, area->y, NULL);
gint ry, rheight, validrow, width, height;
// gint line_width = 0; /* line widths != 0 interfere with dash-settings on some X servers */
GXK_SCROLL_CANVAS_CLASS (bst_track_roll_parent_class)->draw_canvas (scc, drawable, area);
@@ -623,8 +623,7 @@ bst_track_roll_draw_canvas (GxkScrollCanvas *scc,
if (track)
{
BseTrackPartSeq *tps = bse_track_list_parts (track);
- gint i;
- for (i = 0; i < tps->n_tparts; i++)
+ for (uint i = 0; i < tps->n_tparts; i++)
{
static const int ENTRY_INNER_BORDER = 2; /* sigh, no way around this */
PangoRectangle rect = { 0 };
@@ -638,7 +637,7 @@ bst_track_roll_draw_canvas (GxkScrollCanvas *scc,
carea.y = ry;
carea.height = rheight;
gtk_paint_shadow (widget->style, drawable,
- widget->state, // row == self->prelight_row ? GTK_STATE_PRELIGHT : widget->state,
+ STATE (widget), // row == self->prelight_row ? GTK_STATE_PRELIGHT : widget->state,
GTK_SHADOW_OUT, NULL, NULL, NULL,
carea.x, carea.y, carea.width, carea.height);
carea.x += XTHICKNESS (self);
@@ -710,7 +709,7 @@ bst_track_roll_draw_hpanel (GxkScrollCanvas *scc,
*/
if (coord_check_crossing (self, i, CROSSING_TACT4))
{
- guint next_pixel, tact4 = coord_to_tick (self, i, TRUE) + 1;
+ int next_pixel, tact4 = coord_to_tick (self, i, TRUE) + 1;
tact4 /= (self->tpt * 4);
next_pixel = tick_to_coord (self, (tact4 + 1) * (self->tpt * 4));
@@ -718,7 +717,7 @@ bst_track_roll_draw_hpanel (GxkScrollCanvas *scc,
g_snprintf (buffer, 64, "%u", tact4 * 4 + 1);
pango_layout_set_text (PLAYOUT_HPANEL (self), buffer, -1);
pango_layout_get_pixel_extents (PLAYOUT_HPANEL (self), NULL, &rect);
-
+
/* draw this tact if there's enough space */
if (i + rect.width / 2 < (i + next_pixel) / 2)
gdk_draw_layout (drawable, draw_gc,
@@ -727,7 +726,7 @@ bst_track_roll_draw_hpanel (GxkScrollCanvas *scc,
}
else if (self->draw_tact_grid && coord_check_crossing (self, i, CROSSING_TACT))
{
- guint next_pixel, tact = coord_to_tick (self, i, TRUE) + 1;
+ int next_pixel, tact = coord_to_tick (self, i, TRUE) + 1;
tact /= self->tpt;
next_pixel = tick_to_coord (self, (tact + 1) * self->tpt);
@@ -735,7 +734,7 @@ bst_track_roll_draw_hpanel (GxkScrollCanvas *scc,
g_snprintf (buffer, 64, "%u", tact + 1);
pango_layout_set_text (PLAYOUT_HPANEL (self), buffer, -1);
pango_layout_get_pixel_extents (PLAYOUT_HPANEL (self), NULL, &rect);
-
+
/* draw this tact if there's enough space */
if (i + rect.width < (i + next_pixel) / 2) /* don't half width, leave some more space */
gdk_draw_layout (drawable, draw_gc,
@@ -778,7 +777,7 @@ bst_track_roll_draw_vpanel (GxkScrollCanvas *scc,
{
BstTrackRoll *self = BST_TRACK_ROLL (scc);
GtkWidget *widget = GTK_WIDGET (self);
- gint row = coord_to_row (self, area->y, NULL);
+ uint row = coord_to_row (self, area->y, NULL);
gint ry, rheight, validrow, width, height;
gdk_window_get_size (VPANEL (self), &width, &height);
validrow = row_to_coords (self, row, &ry, &rheight);
@@ -793,7 +792,7 @@ bst_track_roll_draw_vpanel (GxkScrollCanvas *scc,
width - 4 * XTHICKNESS (self),
rheight - 2 * YTHICKNESS (self) - 2);
gtk_paint_shadow (widget->style, drawable,
- widget->state, GTK_SHADOW_IN,
+ STATE (widget), GTK_SHADOW_IN,
NULL, NULL, NULL,
XTHICKNESS (self),
ry + 1,
@@ -810,7 +809,7 @@ bst_track_roll_draw_marker (GxkScrollCanvas *scc,
GxkScrollMarker *marker)
{
BstTrackRoll *self = BST_TRACK_ROLL (scc);
- BstTrackRollMarkerType mtype = marker->mtype;
+ BstTrackRollMarkerType mtype = BstTrackRollMarkerType (marker->mtype);
gint x = marker->extends.x, y = marker->extends.y, width = marker->extends.width, height = marker->extends.height;
GdkGC *draw_gc;
switch (mtype)
@@ -1184,18 +1183,18 @@ bst_track_roll_set_marker (BstTrackRoll *self,
}
static void
-bst_track_roll_class_init (BstTrackRollClass *class)
+bst_track_roll_class_init (BstTrackRollClass *klass)
{
static GdkColor colors[CINDEX_COUNT] = {
{ 0, 0xffff, 0x0000, 0x0000 }, /* red */
{ 0, 0x0000, 0xffff, 0x0000 }, /* green */
{ 0, 0x0000, 0x0000, 0xffff }, /* blue */
};
- GObjectClass *gobject_class = G_OBJECT_CLASS (class);
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
- GtkContainerClass *container_class = GTK_CONTAINER_CLASS (class);
- GxkScrollCanvasClass *scroll_canvas_class = GXK_SCROLL_CANVAS_CLASS (class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+ GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
+ GxkScrollCanvasClass *scroll_canvas_class = GXK_SCROLL_CANVAS_CLASS (klass);
gobject_class->finalize = bst_track_roll_finalize;
@@ -1223,26 +1222,26 @@ bst_track_roll_class_init (BstTrackRollClass *class)
scroll_canvas_class->image_tint = gdk_color_from_rgb (0x00ffffff);
scroll_canvas_class->image_saturation = 0;
- class->drag = NULL;
- class->clicked = NULL;
+ klass->drag = NULL;
+ klass->clicked = NULL;
- signal_select_row = g_signal_new ("select-row", G_OBJECT_CLASS_TYPE (class),
+ signal_select_row = g_signal_new ("select-row", G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (BstTrackRollClass, select_row),
NULL, NULL,
bst_marshal_NONE__INT,
G_TYPE_NONE, 1, G_TYPE_INT);
- signal_drag = g_signal_new ("drag", G_OBJECT_CLASS_TYPE (class),
+ signal_drag = g_signal_new ("drag", G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (BstTrackRollClass, drag),
NULL, NULL,
bst_marshal_NONE__POINTER,
G_TYPE_NONE, 1, G_TYPE_POINTER);
- signal_clicked = g_signal_new ("clicked", G_OBJECT_CLASS_TYPE (class),
+ signal_clicked = g_signal_new ("clicked", G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (BstTrackRollClass, clicked),
NULL, NULL,
bst_marshal_NONE__UINT_UINT_INT_BOXED,
G_TYPE_NONE, 4, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_INT,
GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
- signal_stop_edit = g_signal_new ("stop-edit", G_OBJECT_CLASS_TYPE (class),
+ signal_stop_edit = g_signal_new ("stop-edit", G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (BstTrackRollClass, stop_edit),
NULL, NULL,
bst_marshal_NONE__BOOLEAN_OBJECT,
diff --git a/beast-gtk/bsttrackrollctrl.c b/beast-gtk/bsttrackrollctrl.cc
similarity index 99%
rename from beast-gtk/bsttrackrollctrl.c
rename to beast-gtk/bsttrackrollctrl.cc
index 569e77b..d64a704 100644
--- a/beast-gtk/bsttrackrollctrl.c
+++ b/beast-gtk/bsttrackrollctrl.cc
@@ -397,7 +397,7 @@ edit_name_start (BstTrackRollController *self,
{
if (drag->current_track && self->obj_part)
{
- GtkEntry *entry = g_object_new (GTK_TYPE_ENTRY,
+ GtkEntry *entry = (GtkEntry*) g_object_new (GTK_TYPE_ENTRY,
"visible", TRUE,
"has_frame", FALSE,
NULL);
@@ -521,11 +521,10 @@ move_motion (BstTrackRollController *self,
{
const gchar *action = self->skip_deletion ? _("Link Part") : _("Move Part");
gint new_tick;
- gboolean track_changed;
new_tick = MAX (drag->current_tick, self->xoffset) - self->xoffset;
new_tick = bst_track_roll_controller_quantize (self, new_tick);
- track_changed = self->obj_track != drag->current_track;
+ // track_changed = self->obj_track != drag->current_track;
if (new_tick != self->obj_tick || self->obj_track != drag->current_track)
{
bse_item_group_undo (drag->current_track, "Move part");
@@ -560,7 +559,7 @@ editor_create (BstTrackRollController *self,
{
if (self->obj_part) /* got part */
{
- GtkWidget *pdialog = g_object_new (BST_TYPE_PART_DIALOG, NULL);
+ GtkWidget *pdialog = (GtkWidget*) g_object_new (BST_TYPE_PART_DIALOG, NULL);
bst_part_dialog_set_proxy (BST_PART_DIALOG (pdialog), self->obj_part);
g_signal_connect_object (self->troll, "destroy", G_CALLBACK (gtk_widget_destroy), pdialog, G_CONNECT_SWAPPED);
gxk_status_set (GXK_STATUS_DONE, _("Start Editor"), NULL);
diff --git a/beast-gtk/bsttracksynthdialog.c b/beast-gtk/bsttracksynthdialog.cc
similarity index 80%
rename from beast-gtk/bsttracksynthdialog.c
rename to beast-gtk/bsttracksynthdialog.cc
index 3c8414e..fec5198 100644
--- a/beast-gtk/bsttracksynthdialog.c
+++ b/beast-gtk/bsttracksynthdialog.cc
@@ -33,10 +33,10 @@ static void bst_track_synth_dialog_setup (BstTrackSynthDialog *self,
G_DEFINE_TYPE (BstTrackSynthDialog, bst_track_synth_dialog, GXK_TYPE_DIALOG);
static void
-bst_track_synth_dialog_class_init (BstTrackSynthDialogClass *class)
+bst_track_synth_dialog_class_init (BstTrackSynthDialogClass *klass)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (class);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
gobject_class->finalize = bst_track_synth_dialog_finalize;
@@ -60,41 +60,41 @@ bst_track_synth_dialog_init (BstTrackSynthDialog *self)
gxk_dialog_set_sizes (GXK_DIALOG (self), 550, 300, 600, 320);
/* notebook */
- self->notebook = g_object_new (GXK_TYPE_NOTEBOOK,
- "visible", TRUE,
- "homogeneous", TRUE,
- "show_border", TRUE,
- "show_tabs", TRUE,
- "scrollable", FALSE,
- "tab_border", 0,
- "enable_popup", TRUE,
- "tab_pos", GTK_POS_TOP,
- "border_width", 5,
- "parent", main_box,
- "enable_popup", FALSE,
- NULL);
+ self->notebook = (GtkNotebook*) g_object_new (GXK_TYPE_NOTEBOOK,
+ "visible", TRUE,
+ "homogeneous", TRUE,
+ "show_border", TRUE,
+ "show_tabs", TRUE,
+ "scrollable", FALSE,
+ "tab_border", 0,
+ "enable_popup", TRUE,
+ "tab_pos", GTK_POS_TOP,
+ "border_width", 5,
+ "parent", main_box,
+ "enable_popup", FALSE,
+ NULL);
/* synth list */
- self->spage = g_object_new (GTK_TYPE_SCROLLED_WINDOW,
- "visible", TRUE,
- "hscrollbar_policy", GTK_POLICY_AUTOMATIC,
- "vscrollbar_policy", GTK_POLICY_ALWAYS,
- "border_width", 5,
- "shadow_type", GTK_SHADOW_IN,
- NULL);
+ self->spage = (GtkWidget*) g_object_new (GTK_TYPE_SCROLLED_WINDOW,
+ "visible", TRUE,
+ "hscrollbar_policy", GTK_POLICY_AUTOMATIC,
+ "vscrollbar_policy", GTK_POLICY_ALWAYS,
+ "border_width", 5,
+ "shadow_type", GTK_SHADOW_IN,
+ NULL);
gxk_notebook_append (self->notebook, self->spage, "synth", TRUE);
/* synth selection store and tree */
self->pstore = bst_item_seq_store_new (TRUE);
smodel = gtk_tree_model_sort_new_with_model (self->pstore);
- self->tview = g_object_new (GTK_TYPE_TREE_VIEW,
- "visible", TRUE,
- "can_focus", TRUE,
- "model", smodel,
- "rules_hint", TRUE,
- "parent", self->spage,
- "search_column", BST_PROXY_STORE_NAME,
- NULL);
+ self->tview = (GtkTreeView*) g_object_new (GTK_TYPE_TREE_VIEW,
+ "visible", TRUE,
+ "can_focus", TRUE,
+ "model", smodel,
+ "rules_hint", TRUE,
+ "parent", self->spage,
+ "search_column", BST_PROXY_STORE_NAME,
+ NULL);
g_object_unref (smodel);
tsel = gtk_tree_view_get_selection (self->tview);
gtk_tree_selection_set_mode (tsel, GTK_SELECTION_BROWSE);
@@ -117,13 +117,13 @@ bst_track_synth_dialog_init (BstTrackSynthDialog *self)
NULL, NULL, G_CONNECT_SWAPPED);
/* wave repo view */
- self->wpage = g_object_new (BST_TYPE_WAVE_VIEW, "visible", TRUE, NULL);
+ self->wpage = (GtkWidget*) g_object_new (BST_TYPE_WAVE_VIEW, "visible", TRUE, NULL);
gxk_notebook_append (self->notebook, self->wpage, "wave", TRUE);
bst_wave_view_set_editable (BST_WAVE_VIEW (self->wpage), FALSE);
/* provide buttons */
- self->ok = gxk_dialog_default_action_swapped (GXK_DIALOG (self), BST_STOCK_OK, bst_track_synth_dialog_activate, self);
- gxk_dialog_action (GXK_DIALOG (self), BST_STOCK_CANCEL, gxk_toplevel_delete, self);
+ self->ok = gxk_dialog_default_action_swapped (GXK_DIALOG (self), BST_STOCK_OK, (void*) bst_track_synth_dialog_activate, self);
+ gxk_dialog_action (GXK_DIALOG (self), BST_STOCK_CANCEL, (void*) gxk_toplevel_delete, (GtkWidget*) self);
/* make row connections */
g_signal_connect_object (self->tview, "row_activated", G_CALLBACK (gtk_button_clicked), self->ok, G_CONNECT_SWAPPED);
@@ -195,12 +195,12 @@ bst_track_synth_dialog_setup (BstTrackSynthDialog *self,
/* cleanup connections to old parent_window */
if (self->parent_window)
- g_signal_handlers_disconnect_by_func (self->parent_window, parent_window_destroyed, self);
+ g_signal_handlers_disconnect_by_func (self->parent_window, (void*) parent_window_destroyed, self);
if (window->group)
gtk_window_group_remove_window (window->group, window);
gtk_window_set_transient_for (window, NULL);
- self->parent_window = parent_widget ? (GtkWindow*) gtk_widget_get_ancestor (parent_widget, GTK_TYPE_WINDOW) : NULL;
+ self->parent_window = parent_widget ? (GtkWindow*) gtk_widget_get_ancestor ((GtkWidget*) parent_widget, GTK_TYPE_WINDOW) : NULL;
/* setup connections to new parent_window */
if (self->parent_window)
@@ -223,7 +223,7 @@ bst_track_synth_dialog_singleton (void)
{
static BstTrackSynthDialog *ts_singleton = NULL;
if (!ts_singleton)
- ts_singleton = g_object_new (BST_TYPE_TRACK_SYNTH_DIALOG, NULL);
+ ts_singleton = (BstTrackSynthDialog*) g_object_new (BST_TYPE_TRACK_SYNTH_DIALOG, NULL);
return ts_singleton;
}
diff --git a/beast-gtk/bsttrackview.c b/beast-gtk/bsttrackview.cc
similarity index 92%
rename from beast-gtk/bsttrackview.c
rename to beast-gtk/bsttrackview.cc
index 2c1564b..ed88541 100644
--- a/beast-gtk/bsttrackview.c
+++ b/beast-gtk/bsttrackview.cc
@@ -73,10 +73,10 @@ static const GxkStockAction track_view_actions[] = {
G_DEFINE_TYPE (BstTrackView, bst_track_view, BST_TYPE_ITEM_VIEW);
static void
-bst_track_view_class_init (BstTrackViewClass *class)
+bst_track_view_class_init (BstTrackViewClass *klass)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (class);
- BstItemViewClass *item_view_class = BST_ITEM_VIEW_CLASS (class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ BstItemViewClass *item_view_class = BST_ITEM_VIEW_CLASS (klass);
gobject_class->finalize = bst_track_view_finalize;
@@ -258,7 +258,7 @@ typedef struct {
static void
track_view_synth_popup_cleanup (gpointer data)
{
- SynthPopup *sdata = data;
+ SynthPopup *sdata = (SynthPopup*) data;
gxk_cell_renderer_popup_change (sdata->pcell, NULL, FALSE, TRUE);
g_free (sdata);
}
@@ -268,7 +268,7 @@ track_view_synth_popup_cb (gpointer data,
SfiProxy proxy,
BstTrackSynthDialog *tsdialog)
{
- SynthPopup *sdata = data;
+ SynthPopup *sdata = (SynthPopup*) data;
gxk_cell_renderer_popup_change (sdata->pcell,
proxy ? bse_item_get_uname_path (proxy) : "",
FALSE,
@@ -340,7 +340,7 @@ typedef struct {
static void
track_view_outputs_cleanup (gpointer data)
{
- OutputsPopup *odata = data;
+ OutputsPopup *odata = (OutputsPopup*) data;
gxk_cell_renderer_popup_change (odata->pcell, NULL, FALSE, FALSE);
g_free (odata);
}
@@ -350,7 +350,7 @@ track_view_outputs_changed (gpointer data,
BseItemSeq *iseq,
BstItemSeqDialog *isdialog)
{
- OutputsPopup *odata = data;
+ OutputsPopup *odata = (OutputsPopup*) data;
gxk_cell_renderer_popup_change (odata->pcell, NULL, FALSE, FALSE);
SfiSeq *seq = bse_item_seq_to_seq (iseq);
GValue *value = sfi_value_seq (seq);
@@ -374,7 +374,7 @@ track_view_outputs_popup (BstTrackView *self,
BsePropertyCandidates *pc = bse_item_get_property_candidates (item, "outputs");
GParamSpec *pspec = bse_proxy_get_pspec (item, "outputs");
const GValue *value = bse_proxy_get_property (item, "outputs");
- SfiSeq *seq = g_value_get_boxed (value);
+ SfiSeq *seq = (SfiSeq*) g_value_get_boxed (value);
BseItemSeq *iseq = bse_item_seq_from_seq (seq);
OutputsPopup odata = { self, pcell, item };
GtkWidget *dialog = bst_item_seq_dialog_popup (self, item,
@@ -463,9 +463,9 @@ track_view_marks_changed (BstTrackView *self)
{
SfiInt lleft, lright, pointer;
bse_proxy_get (song, "loop_left", &lleft, "loop_right", &lright, "tick_pointer", &pointer, NULL);
- bst_track_roll_set_marker (self->troll, 1, lleft, lleft >= 0 ? BST_TRACK_ROLL_MARKER_LOOP : 0);
- bst_track_roll_set_marker (self->troll, 2, lright, lright >= 0 ? BST_TRACK_ROLL_MARKER_LOOP : 0);
- bst_track_roll_set_marker (self->troll, 3, pointer, pointer >= 0 ? BST_TRACK_ROLL_MARKER_POS : 0);
+ bst_track_roll_set_marker (self->troll, 1, lleft, lleft >= 0 ? BST_TRACK_ROLL_MARKER_LOOP : BST_TRACK_ROLL_MARKER_NONE);
+ bst_track_roll_set_marker (self->troll, 2, lright, lright >= 0 ? BST_TRACK_ROLL_MARKER_LOOP : BST_TRACK_ROLL_MARKER_NONE);
+ bst_track_roll_set_marker (self->troll, 3, pointer, pointer >= 0 ? BST_TRACK_ROLL_MARKER_POS : BST_TRACK_ROLL_MARKER_NONE);
}
}
@@ -528,12 +528,12 @@ bst_track_view_init (BstTrackView *self)
g_object_unref (lwrapper);
/* scrollbars */
- treehs = gxk_radget_find (radget, "tree-hscrollbar");
- trackgb = gxk_radget_find (radget, "track-hgrow-bar");
- vscroll = gxk_radget_find (radget, "tree-vscrollbar");
+ treehs = (GtkWidget*) gxk_radget_find (radget, "tree-hscrollbar");
+ trackgb = (GtkWidget*) gxk_radget_find (radget, "track-hgrow-bar");
+ vscroll = (GtkWidget*) gxk_radget_find (radget, "tree-vscrollbar");
/* tree view (track list) */
- tview = gxk_radget_find (radget, "tree-view");
+ tview = (GtkTreeView*) gxk_radget_find (radget, "tree-view");
gtk_tree_view_set_model (tview, smodel);
bst_item_view_set_tree (iview, tview);
gtk_tree_view_set_hadjustment (iview->tree, gtk_range_get_adjustment (GTK_RANGE (treehs)));
@@ -544,10 +544,10 @@ bst_track_view_init (BstTrackView *self)
g_object_unref (smodel);
/* track roll */
- self->troll = g_object_new (BST_TYPE_TRACK_ROLL,
- "visible", TRUE,
- "parent", gxk_radget_find (radget, "track-area"),
- NULL);
+ self->troll = (BstTrackRoll*) g_object_new (BST_TYPE_TRACK_ROLL,
+ "visible", TRUE,
+ "parent", gxk_radget_find (radget, "track-area"),
+ NULL);
gxk_nullify_in_object (self, &self->troll);
gxk_scroll_canvas_set_hadjustment (GXK_SCROLL_CANVAS (self->troll), bst_grow_bar_get_adjustment (BST_GROW_BAR (trackgb)));
gxk_scroll_canvas_set_vadjustment (GXK_SCROLL_CANVAS (self->troll), gtk_range_get_adjustment (GTK_RANGE (vscroll)));
@@ -576,7 +576,7 @@ bst_track_view_init (BstTrackView *self)
gxk_widget_publish_action_list (self, "tctrl-quant-tools", bst_track_roll_controller_quant_actions (self->tctrl));
/* add repeat toggle */
- self->repeat_toggle = gxk_radget_find (radget, "repeat-toggle");
+ self->repeat_toggle = (GtkWidget*) gxk_radget_find (radget, "repeat-toggle");
gxk_nullify_in_object (self, &self->repeat_toggle);
g_object_connect (self->repeat_toggle, "swapped_signal::toggled", track_view_repeat_toggled, self, NULL);
track_view_repeat_changed (self);
@@ -598,31 +598,31 @@ bst_track_view_init (BstTrackView *self)
if (BST_DVL_HINTS)
gxk_tree_view_add_text_column (iview->tree, COL_SEQID, "S",
0.0, "ID", NULL,
- NULL, NULL, 0);
+ NULL, NULL, GConnectFlags (0));
gxk_tree_view_add_text_column (iview->tree, COL_NAME, "S",
0.0, _("Name"), NULL,
- bst_item_view_name_edited, self, G_CONNECT_SWAPPED);
+ (void*) bst_item_view_name_edited, self, G_CONNECT_SWAPPED);
gxk_tree_view_add_toggle_column (iview->tree, COL_MUTE, "",
0.5, "M", _("Notes from unchecked tracks are ignored by the sequencer during playback"),
- track_view_mute_toggled, self, G_CONNECT_SWAPPED);
+ (void*) track_view_mute_toggled, self, G_CONNECT_SWAPPED);
gxk_tree_view_add_text_column (iview->tree, COL_VOICES, "",
0.5, "V", _("Maximum number of voices for simultaneous playback"),
- track_view_voice_edited, self, G_CONNECT_SWAPPED);
+ (void*) track_view_voice_edited, self, G_CONNECT_SWAPPED);
gxk_tree_view_add_popup_column (iview->tree, COL_SYNTH, "#",
0.5, "Synth", _("Synthesis network or wave to be used as instrument by this track"),
- track_view_synth_edited, track_view_synth_popup, self, G_CONNECT_SWAPPED);
+ (void*) track_view_synth_edited, (void*) track_view_synth_popup, self, G_CONNECT_SWAPPED);
gxk_tree_view_add_text_column (iview->tree, COL_MIDI_CHANNEL, "",
0.5, "Ch", _("Midi channel assigned to this track, 0 uses private per-track channel"),
- track_view_midi_channel_edited, self, G_CONNECT_SWAPPED);
+ (void*) track_view_midi_channel_edited, self, G_CONNECT_SWAPPED);
gxk_tree_view_add_popup_column (iview->tree, COL_OUTPUTS, "#",
0.5, "Outputs", _("Mixer busses connected to track output"),
- NULL, track_view_outputs_popup, self, G_CONNECT_SWAPPED);
+ NULL, (void*) track_view_outputs_popup, self, G_CONNECT_SWAPPED);
gxk_tree_view_add_popup_column (iview->tree, COL_POST_SYNTH, "",
0.5, "Post", _("Synthesis network to be used as postprocessor"),
- track_view_post_synth_edited, track_view_post_synth_popup, self, G_CONNECT_SWAPPED);
+ (void*) track_view_post_synth_edited, (void*) track_view_post_synth_popup, self, G_CONNECT_SWAPPED);
gxk_tree_view_add_text_column (iview->tree, COL_BLURB, "",
0.0, _("Comment"), NULL,
- bst_item_view_blurb_edited, self, G_CONNECT_SWAPPED);
+ (void*) bst_item_view_blurb_edited, self, G_CONNECT_SWAPPED);
}
static void
@@ -641,7 +641,7 @@ track_view_pointer_changed (BstTrackView *self,
SfiInt position)
{
if (self->troll)
- bst_track_roll_set_marker (self->troll, 3, position, position >= 0 ? BST_TRACK_ROLL_MARKER_POS : 0);
+ bst_track_roll_set_marker (self->troll, 3, position, position >= 0 ? BST_TRACK_ROLL_MARKER_POS : BST_TRACK_ROLL_MARKER_NONE);
}
static void
diff --git a/beast-gtk/bsttreestores.c b/beast-gtk/bsttreestores.cc
similarity index 89%
rename from beast-gtk/bsttreestores.c
rename to beast-gtk/bsttreestores.cc
index fe4f892..782f79b 100644
--- a/beast-gtk/bsttreestores.c
+++ b/beast-gtk/bsttreestores.cc
@@ -18,14 +18,15 @@
#include "topconfig.h"
#include <string.h>
+typedef void (*ListenerFunc) (GtkTreeModel *model, SfiProxy item, gboolean added);
/* --- functions --- */
static gboolean
file_store_idle_handler (gpointer data)
{
- GtkTreeModel *model = data;
+ GtkTreeModel *model = (GtkTreeModel*) data;
GtkTreeStore *store = GTK_TREE_STORE (model);
- SfiFileCrawler *crawler = g_object_get_data (store, "file-crawler");
+ SfiFileCrawler *crawler = (SfiFileCrawler*) g_object_get_data ((GObject*) store, "file-crawler");
gchar *file;
gboolean busy = TRUE;
guint n_rows = g_object_get_long (store, "n_rows");
@@ -68,7 +69,7 @@ file_store_idle_handler (gpointer data)
}
g_object_set_long (store, "n_rows", n_rows);
if (!sfi_file_crawler_needs_crawl (crawler))
- g_object_set_data (store, "file-crawler", NULL);
+ g_object_set_data ((GObject*) store, "file-crawler", NULL);
}
else if (n_completed < n_rows)
{
@@ -93,7 +94,7 @@ file_store_idle_handler (gpointer data)
else
{
name = dsep ? dsep + 1 : filename; /* fallback wave name */
- loader = info->error ? bse_error_blurb (info->error) : info->loader;
+ loader = info->error ? bse_error_blurb (BseErrorType (info->error)) : info->loader;
guint l = strlen (filename);
if (info->error == BSE_ERROR_FORMAT_UNKNOWN &&
l >= 4 && g_strcasecmp (filename + l - 4, ".bse") == 0)
@@ -163,7 +164,7 @@ bst_file_store_update_list (GtkTreeModel *model,
g_return_if_fail (search_path != NULL);
sfi_file_crawler_add_search_path (crawler, search_path, filter);
- g_object_set_data_full (store, "file-crawler", crawler, sfi_file_crawler_destroy);
+ g_object_set_data_full ((GObject*) store, "file-crawler", crawler, (GDestroyNotify) sfi_file_crawler_destroy);
l = g_timeout_add_full (G_PRIORITY_LOW + 100, 0,
file_store_idle_handler,
store, NULL);
@@ -177,8 +178,8 @@ bst_file_store_forget_list (GtkTreeModel *model)
glong l;
g_object_set_long (model, "n_rows", 0);
g_object_set_long (model, "n_completed", 0);
- g_object_set_data (model, "file-crawler", NULL);
- g_object_set_data (model, "proxy-seq", NULL);
+ g_object_set_data ((GObject*) model, "file-crawler", NULL);
+ g_object_set_data ((GObject*) model, "proxy-seq", NULL);
l = g_object_get_long (model, "timer");
if (l)
{
@@ -267,7 +268,7 @@ static void
child_list_wrapper_release_container (SfiProxy container,
ProxyStore *ps)
{
- g_object_set_data (ps->self, "ProxyStore", NULL);
+ g_object_set_data ((GObject*) ps->self, "ProxyStore", NULL);
}
static void
@@ -277,9 +278,7 @@ child_list_wrapper_item_added (SfiProxy container,
{
if (BSE_IS_ITEM (item) && bse_proxy_is_a (item, ps->u.cl.child_type))
{
- void (*listener) (GtkTreeModel *model,
- SfiProxy item,
- gboolean added) = g_object_get_data (ps->self, "listener");
+ ListenerFunc listener = (ListenerFunc) g_object_get_data ((GObject*) ps->self, "listener");
sfi_upool_set (ps->u.cl.ipool, item);
proxy_store_item_listen_on (ps, item);
if (listener)
@@ -295,9 +294,7 @@ child_list_wrapper_item_removed (SfiProxy container,
{
if (BSE_IS_ITEM (item) && bse_proxy_is_a (item, ps->u.cl.child_type))
{
- void (*listener) (GtkTreeModel *model,
- SfiProxy item,
- gboolean added) = g_object_get_data (ps->self, "listener");
+ ListenerFunc listener = (ListenerFunc) g_object_get_data ((GObject*) ps->self, "listener");
gint row = seqid - 1;
proxy_store_item_unlisten_on (ps, item, row);
if (row >= 0) /* special case ipool foreach destroy */
@@ -318,7 +315,7 @@ static gboolean
child_list_wrapper_foreach (gpointer data,
gulong unique_id)
{
- ProxyStore *ps = data;
+ ProxyStore *ps = (ProxyStore*) data;
child_list_wrapper_item_removed (0, unique_id, 0, ps);
return TRUE;
}
@@ -326,7 +323,7 @@ child_list_wrapper_foreach (gpointer data,
static void
child_list_wrapper_destroy_data (gpointer data)
{
- ProxyStore *ps = data;
+ ProxyStore *ps = (ProxyStore*) data;
bse_proxy_disconnect (ps->u.cl.container,
"any_signal", child_list_wrapper_release_container, ps,
"any_signal", child_list_wrapper_item_added, ps,
@@ -344,7 +341,7 @@ bst_child_list_wrapper_setup (GxkListWrapper *self,
SfiProxy parent,
const gchar *child_type)
{
- g_object_set_data (self, "ProxyStore", NULL);
+ g_object_set_data ((GObject*) self, "ProxyStore", NULL);
if (parent)
{
ProxyStore *ps = g_new0 (ProxyStore, 1);
@@ -363,7 +360,7 @@ bst_child_list_wrapper_setup (GxkListWrapper *self,
iseq = bse_container_list_children (ps->u.cl.container);
for (i = 0; i < iseq->n_items; i++)
child_list_wrapper_item_added (ps->u.cl.container, iseq->items[i], ps);
- g_object_set_data_full (self, "ProxyStore", ps, child_list_wrapper_destroy_data);
+ g_object_set_data_full ((GObject*) self, "ProxyStore", ps, child_list_wrapper_destroy_data);
}
}
@@ -372,25 +369,23 @@ child_list_wrapper_rebuild_with_listener (GxkListWrapper *self,
gpointer listener,
gboolean set_listener)
{
- ProxyStore *ps = g_object_get_data (self, "ProxyStore");
+ ProxyStore *ps = (ProxyStore*) g_object_get_data ((GObject*) self, "ProxyStore");
SfiProxy parent = ps ? ps->u.cl.container : 0;
gchar *child_type = ps ? g_strdup (ps->u.cl.child_type) : NULL;
/* clear list with old listener */
- g_object_set_data (self, "ProxyStore", NULL);
+ g_object_set_data ((GObject*) self, "ProxyStore", NULL);
/* rebuild with new listener */
if (set_listener)
- g_object_set_data (self, "listener", listener);
+ g_object_set_data ((GObject*) self, "listener", listener);
bst_child_list_wrapper_setup (self, parent, child_type);
g_free (child_type);
}
void
bst_child_list_wrapper_set_listener (GxkListWrapper *self,
- void (*listener) (GtkTreeModel *model,
- SfiProxy item,
- gboolean added))
+ ListenerFunc listener)
{
- child_list_wrapper_rebuild_with_listener (self, listener, TRUE);
+ child_list_wrapper_rebuild_with_listener (self, (void*) listener, TRUE);
}
void
@@ -411,7 +406,7 @@ SfiProxy
bst_child_list_wrapper_get_proxy (GxkListWrapper *self,
gint row)
{
- ProxyStore *ps = g_object_get_data (self, "ProxyStore");
+ ProxyStore *ps = (ProxyStore*) g_object_get_data ((GObject*) self, "ProxyStore");
if (ps && row >= 0)
{
guint seqid = row + 1;
@@ -425,7 +420,7 @@ bst_child_list_wrapper_get_iter (GxkListWrapper *self,
GtkTreeIter *iter,
SfiProxy proxy)
{
- ProxyStore *ps = g_object_get_data (self, "ProxyStore");
+ ProxyStore *ps = (ProxyStore*) g_object_get_data ((GObject*) self, "ProxyStore");
return ps ? proxy_store_get_iter (ps, iter, proxy) : FALSE;
}
@@ -433,7 +428,7 @@ void
bst_child_list_wrapper_proxy_changed (GxkListWrapper *self,
SfiProxy item)
{
- ProxyStore *ps = g_object_get_data (self, "ProxyStore");
+ ProxyStore *ps = (ProxyStore*) g_object_get_data ((GObject*) self, "ProxyStore");
gint row = ps->row_from_proxy (ps, item);
if (row >= 0)
gxk_list_wrapper_notify_change (ps->self, row);
@@ -551,7 +546,7 @@ item_seq_store_row_from_proxy (ProxyStore *ps,
static void
item_seq_store_destroy_data (gpointer data)
{
- ProxyStore *ps = data;
+ ProxyStore *ps = (ProxyStore*) data;
gxk_list_wrapper_notify_clear (ps->self);
SfiRing *ring;
for (ring = ps->u.pq.items; ring; ring = sfi_ring_walk (ring, ps->u.pq.items))
@@ -587,7 +582,7 @@ void
bst_item_seq_store_set (GtkTreeModel *model,
BseItemSeq *iseq)
{
- g_object_set_data (model, "ProxyStore", NULL);
+ g_object_set_data ((GObject*) model, "ProxyStore", NULL);
if (iseq)
{
ProxyStore *ps = g_new0 (ProxyStore, 1);
@@ -601,7 +596,7 @@ bst_item_seq_store_set (GtkTreeModel *model,
SfiRing *ring;
for (ring = ps->u.pq.items; ring; ring = sfi_ring_walk (ring, ps->u.pq.items))
proxy_store_item_listen_on (ps, get_proxy (ring));
- g_object_set_data_full (model, "ProxyStore", ps, item_seq_store_destroy_data);
+ g_object_set_data_full ((GObject*) model, "ProxyStore", ps, item_seq_store_destroy_data);
}
}
@@ -609,7 +604,7 @@ gint
bst_item_seq_store_add (GtkTreeModel *model,
SfiProxy proxy)
{
- ProxyStore *ps = g_object_get_data (model, "ProxyStore");
+ ProxyStore *ps = (ProxyStore*) g_object_get_data ((GObject*) model, "ProxyStore");
if (g_object_get_long (model, "sorted-proxies"))
ps->u.pq.items = sfi_ring_insert_sorted (ps->u.pq.items, (gpointer) proxy, proxy_cmp_sorted, NULL);
else
@@ -622,7 +617,7 @@ gint
bst_item_seq_store_remove (GtkTreeModel *model,
SfiProxy proxy)
{
- ProxyStore *ps = g_object_get_data (model, "ProxyStore");
+ ProxyStore *ps = (ProxyStore*) g_object_get_data ((GObject*) model, "ProxyStore");
gint row = item_seq_store_row_from_proxy (ps, proxy);
if (row >= 0)
{
@@ -636,7 +631,7 @@ gboolean
bst_item_seq_store_can_raise (GtkTreeModel *model,
SfiProxy proxy)
{
- ProxyStore *ps = g_object_get_data (model, "ProxyStore");
+ ProxyStore *ps = (ProxyStore*) g_object_get_data ((GObject*) model, "ProxyStore");
gint row = item_seq_store_row_from_proxy (ps, proxy);
return row > 0;
}
@@ -645,7 +640,7 @@ gint
bst_item_seq_store_raise (GtkTreeModel *model,
SfiProxy proxy)
{
- ProxyStore *ps = g_object_get_data (model, "ProxyStore");
+ ProxyStore *ps = (ProxyStore*) g_object_get_data ((GObject*) model, "ProxyStore");
gint row = item_seq_store_row_from_proxy (ps, proxy);
if (row > 0)
{
@@ -662,7 +657,7 @@ gboolean
bst_item_seq_store_can_lower (GtkTreeModel *model,
SfiProxy proxy)
{
- ProxyStore *ps = g_object_get_data (model, "ProxyStore");
+ ProxyStore *ps = (ProxyStore*) g_object_get_data ((GObject*) model, "ProxyStore");
gint row = item_seq_store_row_from_proxy (ps, proxy);
return row >= 0 && sfi_ring_tail (ps->u.pq.items)->data != (gpointer) proxy;
}
@@ -671,7 +666,7 @@ gint
bst_item_seq_store_lower (GtkTreeModel *model,
SfiProxy proxy)
{
- ProxyStore *ps = g_object_get_data (model, "ProxyStore");
+ ProxyStore *ps = (ProxyStore*) g_object_get_data ((GObject*) model, "ProxyStore");
gint row = item_seq_store_row_from_proxy (ps, proxy);
if (row >= 0 && sfi_ring_tail (ps->u.pq.items)->data != (gpointer) proxy)
{
@@ -687,7 +682,7 @@ bst_item_seq_store_lower (GtkTreeModel *model,
BseItemSeq*
bst_item_seq_store_dup (GtkTreeModel *model)
{
- ProxyStore *ps = g_object_get_data (model, "ProxyStore");
+ ProxyStore *ps = (ProxyStore*) g_object_get_data ((GObject*) model, "ProxyStore");
BseItemSeq *iseq = bse_item_seq_new ();
SfiRing *ring;
for (ring = ps->u.pq.items; ring; ring = sfi_ring_walk (ring, ps->u.pq.items))
@@ -708,7 +703,7 @@ SfiProxy
bst_item_seq_store_get_proxy (GtkTreeModel *model,
gint row)
{
- ProxyStore *ps = g_object_get_data (model, "ProxyStore");
+ ProxyStore *ps = (ProxyStore*) g_object_get_data ((GObject*) model, "ProxyStore");
if (ps && row >= 0)
return get_proxy (sfi_ring_nth (ps->u.pq.items, row));
return 0;
@@ -719,6 +714,6 @@ bst_item_seq_store_get_iter (GtkTreeModel *model,
GtkTreeIter *iter,
SfiProxy proxy)
{
- ProxyStore *ps = g_object_get_data (model, "ProxyStore");
+ ProxyStore *ps = (ProxyStore*) g_object_get_data ((GObject*) model, "ProxyStore");
return ps ? proxy_store_get_iter (ps, iter, proxy) : FALSE;
}
diff --git a/beast-gtk/bstusermessage.c b/beast-gtk/bstusermessage.cc
similarity index 89%
rename from beast-gtk/bstusermessage.c
rename to beast-gtk/bstusermessage.cc
index 7cc1ca6..ef2b7da 100644
--- a/beast-gtk/bstusermessage.c
+++ b/beast-gtk/bstusermessage.cc
@@ -94,14 +94,14 @@ janitor_action (gpointer data,
{
SfiProxy proxy = (SfiProxy) data;
- bse_janitor_trigger_action (proxy, g_object_get_data (G_OBJECT (widget), "user_data"));
+ bse_janitor_trigger_action (proxy, (const char*) g_object_get_data (G_OBJECT (widget), "user_data"));
}
static void
toggle_update_filter (GtkWidget *toggle,
gpointer data)
{
- const gchar *config_check = data;
+ const gchar *config_check = (const char*) data;
if (config_check && bst_msg_absorb_config_adjust (config_check, GTK_TOGGLE_BUTTON (toggle)->active, TRUE))
bst_msg_absorb_config_save();
}
@@ -161,7 +161,7 @@ bst_msg_dialog_update (GxkDialog *dialog,
if (primary)
{
gchar *text = adapt_message_spacing (primary_prefix, primary, NULL);
- GtkWidget *label = g_object_new (GTK_TYPE_LABEL, "visible", TRUE, "label", text, "selectable", TRUE, NULL);
+ GtkWidget *label = (GtkWidget*) g_object_new (GTK_TYPE_LABEL, "visible", TRUE, "label", text, "selectable", TRUE, NULL);
gxk_label_set_attributes (GTK_LABEL (label),
PANGO_ATTR_SCALE, PANGO_SCALE_LARGE,
PANGO_ATTR_WEIGHT, PANGO_WEIGHT_BOLD,
@@ -179,7 +179,7 @@ bst_msg_dialog_update (GxkDialog *dialog,
// GXK_SCROLL_TEXT_CENTER |
GXK_SCROLL_TEXT_VFIXED,
text_message);
- GtkWidget *main_text = g_object_new (GTK_TYPE_ALIGNMENT,
+ GtkWidget *main_text = (GtkWidget*) g_object_new (GTK_TYPE_ALIGNMENT,
"visible", TRUE,
"xalign", 0.5,
"yalign", 0.5,
@@ -196,13 +196,13 @@ bst_msg_dialog_update (GxkDialog *dialog,
/* setup data for recognition and message repetition counter */
if (accumulate_repetitions)
{
- g_object_set_data_full (dialog, "BEAST-message-hashkey", strdup_msg_hashkey (msg), g_free);
- GtkWidget *label = g_object_new (GTK_TYPE_LABEL, "visible", FALSE, "xalign", 1.0, "label", "", NULL);
+ g_object_set_data_full ((GObject*) dialog, "BEAST-message-hashkey", strdup_msg_hashkey (msg), g_free);
+ GtkWidget *label = (GtkWidget*) g_object_new (GTK_TYPE_LABEL, "visible", FALSE, "xalign", 1.0, "label", "", NULL);
gtk_table_attach (GTK_TABLE (table), label,
1, 2, row, row + 1, /* left/right, top/bottom */
GTK_FILL | GTK_EXPAND, GTK_FILL, 5, 5);
row++;
- g_object_set_data_full (dialog, "BEAST-user-message-repeater", g_object_ref (label), g_object_unref);
+ g_object_set_data_full ((GObject*) dialog, "BEAST-user-message-repeater", g_object_ref (label), g_object_unref);
g_object_set_int (dialog, "BEAST-user-message-count", 1);
}
/* add details section */
@@ -232,7 +232,7 @@ bst_msg_dialog_update (GxkDialog *dialog,
g_string_erase (gstring, gstring->len - 1, 1);
gchar *text = adapt_message_spacing (NULL, gstring->str, NULL);
g_string_free (gstring, TRUE);
- GtkWidget *label = g_object_new (GTK_TYPE_LABEL, "visible", TRUE, "wrap", TRUE, "xalign", 0.0, "label", text, "selectable", TRUE, NULL);
+ GtkWidget *label = (GtkWidget*) g_object_new (GTK_TYPE_LABEL, "visible", TRUE, "wrap", TRUE, "xalign", 0.0, "label", text, "selectable", TRUE, NULL);
g_free (text);
gxk_label_set_attributes (GTK_LABEL (label),
PANGO_ATTR_FAMILY, "monospace",
@@ -250,10 +250,10 @@ bst_msg_dialog_update (GxkDialog *dialog,
}
if (1) /* table vexpansion */
{
- GtkWidget *space = g_object_new (GTK_TYPE_ALIGNMENT, "visible", TRUE, NULL);
+ GtkWidget *space = (GtkWidget*) g_object_new (GTK_TYPE_ALIGNMENT, "visible", TRUE, NULL);
gtk_table_attach (GTK_TABLE (table), space,
1, 2, row, row + 1, /* left/right, top/bottom */
- 0, GTK_EXPAND, 0, 0);
+ GtkAttachOptions (0), GTK_EXPAND, 0, 0);
row++;
}
if (msg->config_check)
@@ -289,13 +289,13 @@ bst_msg_dialog_janitor_update (GxkDialog *dialog,
if (action)
{
GtkWidget *button = gxk_dialog_action_multi (dialog, name,
- janitor_action, (gpointer) janitor,
+ (void*) janitor_action, (gpointer) janitor,
action, GXK_DIALOG_MULTI_SWAPPED);
g_object_set_data_full (G_OBJECT (button), "user_data", g_strdup (action), g_free);
gxk_widget_set_tooltip (button, blurb);
}
}
- GtkWidget *bwidget = gxk_dialog_action (dialog, BST_STOCK_CANCEL, gxk_toplevel_delete, NULL);
+ GtkWidget *bwidget = gxk_dialog_action (dialog, BST_STOCK_CANCEL, (void*) gxk_toplevel_delete, NULL);
gxk_dialog_set_focus (dialog, bwidget);
}
@@ -353,14 +353,14 @@ message_dialog_choice_triggered (GtkWidget *choice,
{
GtkWidget *toplevel = gtk_widget_get_toplevel (choice);
if (GXK_IS_DIALOG (toplevel))
- g_object_set_data (toplevel, "bst-modal-choice-result", data);
+ g_object_set_data ((GObject*) toplevel, "bst-modal-choice-result", data);
gxk_toplevel_delete (choice);
}
static void
repeat_dialog (GxkDialog *dialog)
{
- GtkLabel *label = g_object_get_data (dialog, "BEAST-user-message-repeater");
+ GtkLabel *label = (GtkLabel*) g_object_get_data ((GObject*) dialog, "BEAST-user-message-repeater");
if (label)
{
gint count = g_object_get_int (dialog, "BEAST-user-message-count");
@@ -381,10 +381,10 @@ find_dialog (GSList *dialog_list,
GSList *slist;
for (slist = dialog_list; slist; slist = slist->next)
{
- const gchar *hk = g_object_get_data (slist->data, "BEAST-message-hashkey");
+ const gchar *hk = (const gchar*) g_object_get_data ((GObject*) slist->data, "BEAST-message-hashkey");
if (hk && strcmp (hk, mid) == 0)
{
- widget = slist->data;
+ widget = (GtkWidget*) slist->data;
break;
}
}
@@ -443,7 +443,7 @@ bst_message_handler (const BstMessage *const_msg)
}
}
/* create new dialog */
- dialog = gxk_dialog_new (NULL, NULL, 0, NULL, NULL);
+ dialog = (GxkDialog*) gxk_dialog_new (NULL, NULL, GxkDialogFlags (0), NULL, NULL);
gxk_dialog_set_sizes (dialog, -1, -1, 512, -1);
bst_msg_dialog_update (dialog, &msg, TRUE); /* deletes actions */
g_object_connect (dialog, "signal::destroy", dialog_destroyed, NULL, NULL);
@@ -453,8 +453,8 @@ bst_message_handler (const BstMessage *const_msg)
for (j = 0; j < msg.n_msg_bits; j++)
{
const BstMsgBit *mbit = msg.msg_bits[j];
- GtkWidget *widget = gxk_dialog_action_multi (dialog, mbit->text, message_dialog_choice_triggered, (gpointer) mbit->id, mbit->stock_icon,
- mbit->options && strchr (mbit->options, 'D') ? GXK_DIALOG_MULTI_DEFAULT : 0);
+ GtkWidget *widget = gxk_dialog_action_multi (dialog, mbit->text, (void*) message_dialog_choice_triggered, (void*) size_t (mbit->id), mbit->stock_icon,
+ mbit->options && strchr (mbit->options, 'D') ? GXK_DIALOG_MULTI_DEFAULT : GxkDialogMultiFlags (0));
if (mbit->options && strchr (mbit->options, 'I'))
gtk_widget_set_sensitive (widget, FALSE);
}
@@ -467,7 +467,7 @@ bst_message_handler (const BstMessage *const_msg)
}
else
{
- g_object_set_data (dialog, "bst-modal-choice-result", (gpointer) 0);
+ g_object_set_data ((GObject*) dialog, "bst-modal-choice-result", (gpointer) 0);
gxk_dialog_add_flags (dialog, GXK_DIALOG_POPUP_POS | GXK_DIALOG_MODAL);
g_object_ref (dialog);
dialog_show_above_modals (dialog, TRUE);
@@ -477,7 +477,7 @@ bst_message_handler (const BstMessage *const_msg)
g_main_iteration (TRUE);
GDK_THREADS_ENTER ();
}
- result = (guint) g_object_get_data (dialog, "bst-modal-choice-result");
+ result = size_t (g_object_get_data ((GObject*) dialog, "bst-modal-choice-result"));
g_object_unref (dialog);
}
return result;
@@ -486,15 +486,15 @@ bst_message_handler (const BstMessage *const_msg)
static BstMsgType
bst_msg_type_from_user_msg_type (BseMsgType utype)
{
- BIRNET_STATIC_ASSERT (BST_MSG_NONE == BSE_MSG_NONE);
- BIRNET_STATIC_ASSERT (BST_MSG_ALWAYS == BSE_MSG_ALWAYS);
- BIRNET_STATIC_ASSERT (BST_MSG_ERROR == BSE_MSG_ERROR);
- BIRNET_STATIC_ASSERT (BST_MSG_WARNING == BSE_MSG_WARNING);
- BIRNET_STATIC_ASSERT (BST_MSG_SCRIPT == BSE_MSG_SCRIPT);
- BIRNET_STATIC_ASSERT (BST_MSG_INFO == BSE_MSG_INFO);
- BIRNET_STATIC_ASSERT (BST_MSG_DIAG == BSE_MSG_DIAG);
- BIRNET_STATIC_ASSERT (BST_MSG_DEBUG == BSE_MSG_DEBUG);
- return utype;
+ BIRNET_STATIC_ASSERT (BST_MSG_NONE == (uint) BSE_MSG_NONE);
+ BIRNET_STATIC_ASSERT (BST_MSG_ALWAYS == (uint) BSE_MSG_ALWAYS);
+ BIRNET_STATIC_ASSERT (BST_MSG_ERROR == (uint) BSE_MSG_ERROR);
+ BIRNET_STATIC_ASSERT (BST_MSG_WARNING == (uint) BSE_MSG_WARNING);
+ BIRNET_STATIC_ASSERT (BST_MSG_SCRIPT == (uint) BSE_MSG_SCRIPT);
+ BIRNET_STATIC_ASSERT (BST_MSG_INFO == (uint) BSE_MSG_INFO);
+ BIRNET_STATIC_ASSERT (BST_MSG_DIAG == (uint) BSE_MSG_DIAG);
+ BIRNET_STATIC_ASSERT (BST_MSG_DEBUG == (uint) BSE_MSG_DEBUG);
+ return BstMsgType (utype);
}
static void
@@ -508,8 +508,8 @@ message_fill_from_script (BstMessage *msg,
{
msg->log_domain = NULL;
msg->type = mtype;
- msg->ident = sfi_msg_type_ident (msg->type);
- msg->label = sfi_msg_type_label (msg->type);
+ msg->ident = sfi_msg_type_ident (SfiMsgType (msg->type));
+ msg->label = sfi_msg_type_label (SfiMsgType (msg->type));
const gchar *proc_title = NULL;
if (hastext (proc_name))
{
@@ -626,9 +626,9 @@ janitor_window_deleted (GxkDialog *dialog)
static GtkWidget*
create_janitor_dialog (SfiProxy janitor)
{
- GxkDialog *dialog = gxk_dialog_new (NULL, NULL,
- GXK_DIALOG_STATUS_BAR, // | GXK_DIALOG_WINDOW_GROUP,
- NULL, NULL);
+ GxkDialog *dialog = (GxkDialog*) gxk_dialog_new (NULL, NULL,
+ GXK_DIALOG_STATUS_BAR, // | GXK_DIALOG_WINDOW_GROUP,
+ NULL, NULL);
gxk_dialog_set_sizes (dialog, -1, -1, 512, -1);
g_object_set_data (G_OBJECT (dialog), "user-data", (gpointer) janitor);
@@ -652,8 +652,8 @@ bst_message_synth_msg_handler (const BseMessage *umsg)
BstMessage msg = { 0, };
msg.log_domain = umsg->log_domain;
msg.type = bst_msg_type_from_user_msg_type (umsg->type);
- msg.ident = sfi_msg_type_ident (msg.type);
- msg.label = sfi_msg_type_label (msg.type);
+ msg.ident = sfi_msg_type_ident (SfiMsgType (msg.type));
+ msg.label = sfi_msg_type_label (SfiMsgType (msg.type));
msg.config_check = umsg->config_check;
msg.title = umsg->title;
msg.primary = umsg->primary;
@@ -711,8 +711,8 @@ bst_message_dialog_display (const char *log_domain,
BstMessage msg = { 0, };
msg.log_domain = log_domain;
msg.type = mtype;
- msg.ident = sfi_msg_type_ident (mtype);
- msg.label = sfi_msg_type_label (mtype);
+ msg.ident = sfi_msg_type_ident (SfiMsgType (mtype));
+ msg.label = sfi_msg_type_label (SfiMsgType (mtype));
msg.janitor = bse_script_janitor();
msg.process = sfi_thread_get_name (NULL);
msg.pid = sfi_thread_get_pid (NULL);
@@ -766,7 +766,7 @@ void
bst_message_dialogs_popdown (void)
{
while (msg_windows)
- gtk_widget_destroy (msg_windows->data);
+ gtk_widget_destroy ((GtkWidget*) msg_windows->data);
}
static void
@@ -814,8 +814,8 @@ bst_message_connect_to_server (void)
static int
msg_id_compare (const void *v1, const void *v2)
{
- const BstMsgID *mid1 = v1;
- const BstMsgID *mid2 = v2;
+ const BstMsgID *mid1 = (const BstMsgID*) v1;
+ const BstMsgID *mid2 = (const BstMsgID*) v2;
return strcmp (mid1->ident, mid2->ident);
}
@@ -828,15 +828,15 @@ bst_message_list_types (guint *n_types)
{
BstMsgID *msg_ids = NULL;
guint i = 0;
- const gchar *ident = sfi_msg_type_ident (i);
+ const gchar *ident = sfi_msg_type_ident (SfiMsgType (i));
while (ident)
{
msg_ids = g_renew (BstMsgID, msg_ids, i + 1);
msg_ids[i].type = i;
msg_ids[i].ident = ident;
- msg_ids[i].label = sfi_msg_type_label (msg_ids[i].type);
+ msg_ids[i].label = sfi_msg_type_label (SfiMsgType (msg_ids[i].type));
i++;
- ident = sfi_msg_type_ident (i);
+ ident = sfi_msg_type_ident (SfiMsgType (i));
}
msg_ids = g_renew (BstMsgID, msg_ids, i + 1);
msg_ids[i].type = 0;
diff --git a/beast-gtk/bstusermessage.h b/beast-gtk/bstusermessage.h
index 9239b8e..6d611fc 100644
--- a/beast-gtk/bstusermessage.h
+++ b/beast-gtk/bstusermessage.h
@@ -96,8 +96,8 @@ BstMsgBit* bst_msg_bit_create_choice (guint id,
#define BST_MSG_CHOICE(id, name, stock_icon) bst_msg_bit_create_choice (id, name, stock_icon, "C") /* choice */
#define BST_MSG_CHOICE_D(id, name, stock_icon) bst_msg_bit_create_choice (id, name, stock_icon, "D") /* default */
#define BST_MSG_CHOICE_S(id, name, sticn, sens) bst_msg_bit_create_choice (id, name, sticn, (sens) ? "" : "I") /* insensitive */
-#define BST_MSG_DIALOG(lvl, ...) ({ BstMsgType __mt = lvl; guint __result = 0; \
- if (sfi_msg_check (__mt)) { \
+#define BST_MSG_DIALOG(lvl, ...) ({ BstMsgType __mt = lvl; uint __result = 0; \
+ if (sfi_msg_check (SfiMsgType (__mt))) { \
BstMsgBit *__ba[] = { __VA_ARGS__ }; \
__result = bst_message_dialog_display (BIRNET_LOG_DOMAIN, \
__mt, BIRNET_ARRAY_SIZE (__ba), __ba); } \
diff --git a/beast-gtk/bstutils.c b/beast-gtk/bstutils.cc
similarity index 94%
rename from beast-gtk/bstutils.c
rename to beast-gtk/bstutils.cc
index f2d5dc1..8a7ca2a 100644
--- a/beast-gtk/bstutils.c
+++ b/beast-gtk/bstutils.cc
@@ -60,7 +60,7 @@ _bst_init_utils (void)
/* initialize generated type ids */
{
static struct {
- gchar *type_name;
+ const char *type_name;
GType parent;
GType *type_id;
gconstpointer pointer1;
@@ -73,9 +73,9 @@ _bst_init_utils (void)
GType type_id = 0;
if (builtin_info[i].parent == G_TYPE_ENUM)
- type_id = g_enum_register_static (builtin_info[i].type_name, builtin_info[i].pointer1);
+ type_id = g_enum_register_static (builtin_info[i].type_name, (const GEnumValue*) builtin_info[i].pointer1);
else if (builtin_info[i].parent == G_TYPE_FLAGS)
- type_id = g_flags_register_static (builtin_info[i].type_name, builtin_info[i].pointer1);
+ type_id = g_flags_register_static (builtin_info[i].type_name, (const GFlagsValue*) builtin_info[i].pointer1);
else
g_assert_not_reached ();
g_assert (g_type_name (type_id) != NULL);
@@ -156,7 +156,7 @@ bst_stock_dbutton (const gchar *stock_id)
GtkWidget*
bst_stock_icon_button (const gchar *stock_id)
{
- GtkWidget *w = g_object_new (GTK_TYPE_BUTTON,
+ GtkWidget *w = (GtkWidget*) g_object_new (GTK_TYPE_BUTTON,
"visible", TRUE,
"child", gtk_image_new_from_stock (stock_id, GXK_ICON_SIZE_BUTTON),
"can-focus", FALSE,
@@ -178,7 +178,7 @@ bst_stock_register_icon (const gchar *stock_id,
if (!gtk_icon_factory_lookup (stock_icon_factory, stock_id))
{
- GdkPixbuf *pixbuf = gdk_pixbuf_new_from_data (g_memdup (pixels, rowstride * height),
+ GdkPixbuf *pixbuf = gdk_pixbuf_new_from_data ((guchar*) g_memdup (pixels, rowstride * height),
GDK_COLORSPACE_RGB, bytes_per_pixel == 4,
8, width, height,
width * bytes_per_pixel,
@@ -247,7 +247,7 @@ sync_title (TitleSync *tsync)
static void
free_title_sync (gpointer data)
{
- TitleSync *tsync = data;
+ TitleSync *tsync = (TitleSync*) data;
bse_proxy_disconnect (tsync->proxy,
"any_signal", sync_title, tsync,
@@ -262,8 +262,8 @@ bst_window_sync_title_to_proxy (gpointer window,
SfiProxy proxy,
const gchar *title_format)
{
- gchar *p;
-
+ const char *p;
+
g_return_if_fail (GTK_IS_WINDOW (window));
if (proxy)
{
@@ -271,25 +271,23 @@ bst_window_sync_title_to_proxy (gpointer window,
g_return_if_fail (title_format != NULL);
/* g_return_if_fail (strstr (title_format, "%s") != NULL); */
}
-
p = title_format ? strstr (title_format, "%s") : NULL;
if (proxy && p)
{
TitleSync *tsync = g_new0 (TitleSync, 1);
-
- tsync->window = window;
+ tsync->window = (GtkWindow*) window;
tsync->proxy = proxy;
tsync->title1 = g_strndup (title_format, p - title_format);
tsync->title2 = g_strdup (p + 2);
bse_proxy_connect (tsync->proxy,
"swapped_signal::property-notify::uname", sync_title, tsync,
NULL);
- g_object_set_data_full (window, "bst-title-sync", tsync, free_title_sync);
+ g_object_set_data_full ((GObject*) window, "bst-title-sync", tsync, free_title_sync);
sync_title (tsync);
}
else
{
- g_object_set_data (window, "bst-title-sync", NULL);
+ g_object_set_data ((GObject*) window, "bst-title-sync", NULL);
g_object_set (window, "title", title_format, NULL);
}
}
@@ -310,12 +308,12 @@ bst_background_handlers_timeout (gpointer timeout_data)
if (background_handlers1 || background_handlers2)
{
gxk_status_set (GXK_STATUS_PROGRESS, _("Updating View"), NULL);
- BackgroundHandler *bgh = sfi_ring_pop_head (&background_handlers1);
+ BackgroundHandler *bgh = (BackgroundHandler*) sfi_ring_pop_head (&background_handlers1);
gint prio = 1;
if (!bgh)
{
prio = 2;
- bgh = sfi_ring_pop_head (&background_handlers2);
+ bgh = (BackgroundHandler*) sfi_ring_pop_head (&background_handlers2);
}
if (bgh->handler (bgh->data))
{
@@ -438,10 +436,10 @@ bst_util_pack (GtkWidget *widget,
if (child)
{
if (border)
- child = g_object_new (GTK_TYPE_ALIGNMENT,
- "child", child,
- "border_width", border * spacing,
- NULL);
+ child = (GtkWidget*) g_object_new (GTK_TYPE_ALIGNMENT,
+ "child", child,
+ "border_width", border * spacing,
+ NULL);
if (start)
gtk_box_pack_start (box, child, expand, fill, padding);
else
@@ -456,7 +454,7 @@ bst_vpack (const gchar *first_location,
...)
{
va_list args;
- GtkWidget *box = g_object_new (GTK_TYPE_VBOX,
+ GtkWidget *box = (GtkWidget*) g_object_new (GTK_TYPE_VBOX,
"spacing", SPACING,
NULL);
va_start (args, first_location);
@@ -471,7 +469,7 @@ bst_hpack (const gchar *first_location,
...)
{
va_list args;
- GtkWidget *box = g_object_new (GTK_TYPE_HBOX,
+ GtkWidget *box = (GtkWidget*) g_object_new (GTK_TYPE_HBOX,
"spacing", SPACING,
NULL);
va_start (args, first_location);
@@ -486,7 +484,7 @@ bst_vpack0 (const gchar *first_location,
...)
{
va_list args;
- GtkWidget *box = g_object_new (GTK_TYPE_VBOX,
+ GtkWidget *box = (GtkWidget*) g_object_new (GTK_TYPE_VBOX,
"spacing", 0,
NULL);
va_start (args, first_location);
@@ -501,7 +499,7 @@ bst_hpack0 (const gchar *first_location,
...)
{
va_list args;
- GtkWidget *box = g_object_new (GTK_TYPE_HBOX,
+ GtkWidget *box = (GtkWidget*) g_object_new (GTK_TYPE_HBOX,
"spacing", 0,
NULL);
va_start (args, first_location);
@@ -597,7 +595,7 @@ typedef struct {
static void
gmask_destroy (gpointer data)
{
- GMask *gmask = data;
+ GMask *gmask = (GMask*) data;
if (gmask->parent)
g_object_unref (gmask->parent);
@@ -631,7 +629,7 @@ gmask_form (GtkWidget *parent,
gmask = g_new0 (GMask, 1);
g_object_set_qdata_full (G_OBJECT (action), gmask_quark, gmask, gmask_destroy);
- gmask->parent = g_object_ref (parent);
+ gmask->parent = (GtkWidget*) g_object_ref (parent);
gtk_object_sink (GTK_OBJECT (parent));
gmask->action = action;
gmask->gpack = gpack;
@@ -699,7 +697,7 @@ bst_gmask_form (GtkWidget *gmask_container,
GtkWidget *action,
BstGMaskPack gpack)
{
- return gmask_form (gmask_container, action, gpack);
+ return (BstGMask*) gmask_form (gmask_container, action, gpack);
}
/**
@@ -741,7 +739,7 @@ bst_gmask_set_prompt (BstGMask *mask,
if (gmask->prompt)
g_object_unref (gmask->prompt);
- gmask->prompt = g_object_ref (widget);
+ gmask->prompt = (GtkWidget*) g_object_ref (widget);
gtk_object_sink (GTK_OBJECT (widget));
}
@@ -764,7 +762,7 @@ bst_gmask_set_aux1 (BstGMask *mask,
if (gmask->aux1)
g_object_unref (gmask->aux1);
- gmask->aux1 = g_object_ref (widget);
+ gmask->aux1 = (GtkWidget*) g_object_ref (widget);
gtk_object_sink (GTK_OBJECT (widget));
}
@@ -789,7 +787,7 @@ bst_gmask_set_aux2 (BstGMask *mask,
if (gmask->aux2)
g_object_unref (gmask->aux2);
- gmask->aux2 = g_object_ref (widget);
+ gmask->aux2 = (GtkWidget*) g_object_ref (widget);
gtk_object_sink (GTK_OBJECT (widget));
}
@@ -812,7 +810,7 @@ bst_gmask_set_aux3 (BstGMask *mask,
if (gmask->aux3)
g_object_unref (gmask->aux3);
- gmask->aux3 = g_object_ref (widget);
+ gmask->aux3 = (GtkWidget*) g_object_ref (widget);
gtk_object_sink (GTK_OBJECT (widget));
}
@@ -940,7 +938,7 @@ bst_gmask_foreach (BstGMask *mask,
gpointer data)
{
GMask *gmask;
- GtkCallback callback = func;
+ GtkCallback callback = GtkCallback (func);
g_return_if_fail (GTK_IS_WIDGET (mask));
gmask = GMASK_GET (mask);
@@ -999,7 +997,7 @@ table_max_bottom_row (GtkTable *table,
for (list = table->children; list; list = list->next)
{
- GtkTableChild *child = list->data;
+ GtkTableChild *child = (GtkTableChild*) list->data;
if (child->left_attach < right_col && child->right_attach > left_col)
max_bottom = MAX (max_bottom, child->bottom_attach);
@@ -1049,14 +1047,14 @@ bst_gmask_pack (BstGMask *mask)
if (dislodge_columns)
{
gchar *dummy_name = g_strdup_printf ("GMask-dummy-dislodge-%u", MAX (gmask->column, 1) - 1);
- GtkWidget *dislodge = g_object_get_data (G_OBJECT (table), dummy_name);
+ GtkWidget *dislodge = (GtkWidget*) g_object_get_data (G_OBJECT (table), dummy_name);
if (!dislodge)
{
- dislodge = g_object_new (GTK_TYPE_ALIGNMENT, "visible", TRUE, NULL);
+ dislodge = (GtkWidget*) g_object_new (GTK_TYPE_ALIGNMENT, "visible", TRUE, NULL);
g_object_set_data_full (G_OBJECT (table), dummy_name, g_object_ref (dislodge), g_object_unref);
c = MAX (gmask->column, 1) * 6;
- gtk_table_attach (table, dislodge, c - 1, c, 0, 1, GTK_EXPAND, 0, 0, 0);
+ gtk_table_attach (table, dislodge, c - 1, c, 0, 1, GTK_EXPAND, GtkAttachOptions (0), 0, 0);
}
g_free (dummy_name);
}
@@ -1079,10 +1077,9 @@ bst_gmask_pack (BstGMask *mask)
c++;
if (!aux2 && !dislodge_columns)
{
- gchar *dummy_name = g_strdup_printf ("GMask-dummy-aux2-%u", gmask->column);
-
- aux2 = g_object_get_data (G_OBJECT (table), dummy_name);
-
+ char *dummy_name = g_strdup_printf ("GMask-dummy-aux2-%u", gmask->column);
+ aux2 = (GtkWidget*) g_object_get_data (G_OBJECT (table), dummy_name);
+
/* need to have at least 1 (dummy) aux2-child per table column to eat up
* expanding space in this column if !dislodge_columns
*/
@@ -1103,7 +1100,7 @@ bst_gmask_pack (BstGMask *mask)
c += 6 * gmask->column;
gtk_table_attach (table, aux2,
left_col, c + 1,
- row, row + 1, GTK_EXPAND | GTK_FILL, 0, 0, 0);
+ row, row + 1, GTK_EXPAND | GTK_FILL, GtkAttachOptions (0), 0, 0);
if (dummy_aux2)
aux2 = NULL;
if (aux2)
@@ -1185,8 +1182,8 @@ bst_gmask_quick (GtkWidget *gmask_container,
gpointer action,
const gchar *tip_text)
{
- gpointer mask = bst_gmask_form (gmask_container, action, BST_GMASK_INTERLEAVE);
-
+ BstGMask *mask = bst_gmask_form (gmask_container, (GtkWidget*) action, BST_GMASK_INTERLEAVE);
+
if (prompt)
bst_gmask_set_prompt (mask, g_object_new (GTK_TYPE_LABEL,
"visible", TRUE,
@@ -1209,7 +1206,7 @@ typedef struct {
static void
nchildren_free (gpointer data)
{
- NChildren *children = data;
+ NChildren *children = (NChildren*) data;
g_datalist_clear (&children->qdata);
g_free (children);
@@ -1235,7 +1232,7 @@ bst_container_set_named_child (GtkWidget *container,
if (!quark_container_named_children)
quark_container_named_children = g_quark_from_static_string ("BstContainer-named_children");
- children = g_object_get_qdata (G_OBJECT (container), quark_container_named_children);
+ children = (NChildren*) g_object_get_qdata (G_OBJECT (container), quark_container_named_children);
if (!children)
{
children = g_new (NChildren, 1);
@@ -1258,10 +1255,10 @@ bst_container_get_named_child (GtkWidget *container,
g_return_val_if_fail (GTK_IS_CONTAINER (container), NULL);
g_return_val_if_fail (qname > 0, NULL);
- children = quark_container_named_children ? g_object_get_qdata (G_OBJECT (container), quark_container_named_children) : NULL;
+ children = quark_container_named_children ? (NChildren*) g_object_get_qdata (G_OBJECT (container), quark_container_named_children) : NULL;
if (children)
{
- GtkWidget *child = g_datalist_id_get_data (&children->qdata, qname);
+ GtkWidget *child = (GtkWidget*) g_datalist_id_get_data (&children->qdata, qname);
if (child && !gtk_widget_is_ancestor (child, container))
{
diff --git a/beast-gtk/bstwaveeditor.c b/beast-gtk/bstwaveeditor.cc
similarity index 83%
rename from beast-gtk/bstwaveeditor.c
rename to beast-gtk/bstwaveeditor.cc
index 2db031d..a20f12a 100644
--- a/beast-gtk/bstwaveeditor.c
+++ b/beast-gtk/bstwaveeditor.cc
@@ -21,7 +21,7 @@
#include "bstmenus.h"
#include <gdk/gdkkeysyms.h>
-
+extern "C" guint64 bse_engine_tick_stamp_from_systime (guint64 systime); // FIXME
enum {
SCROLL_NONE = 0,
@@ -83,7 +83,7 @@ bst_wave_editor_get_type (void)
{
GtkTypeInfo wave_editor_info =
{
- "BstWaveEditor",
+ (char*) "BstWaveEditor",
sizeof (BstWaveEditor),
sizeof (BstWaveEditorClass),
(GtkClassInitFunc) bst_wave_editor_class_init,
@@ -100,13 +100,13 @@ bst_wave_editor_get_type (void)
}
static void
-bst_wave_editor_class_init (BstWaveEditorClass *class)
+bst_wave_editor_class_init (BstWaveEditorClass *klass)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (class);
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
- // GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
+ // GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- parent_class = g_type_class_peek_parent (class);
+ parent_class = g_type_class_peek_parent (klass);
gobject_class->finalize = bst_wave_editor_finalize;
@@ -136,28 +136,28 @@ bst_wave_editor_init (BstWaveEditor *self)
self, G_CONNECT_SWAPPED);
/* chunk list / qsampler paned container */
- paned = g_object_new (GTK_TYPE_VPANED,
- "visible", TRUE,
- "parent", self->main_vbox,
- NULL);
+ paned = (GtkWidget*) g_object_new (GTK_TYPE_VPANED,
+ "visible", TRUE,
+ "parent", self->main_vbox,
+ NULL);
/* chunk list widgets */
- any = g_object_new (GTK_TYPE_SCROLLED_WINDOW,
- "visible", TRUE,
- "hscrollbar_policy", GTK_POLICY_AUTOMATIC,
- "vscrollbar_policy", GTK_POLICY_ALWAYS,
- "height_request", 120,
- "border_width", 5,
- "shadow_type", GTK_SHADOW_IN,
- NULL);
+ any = (GtkWidget*) g_object_new (GTK_TYPE_SCROLLED_WINDOW,
+ "visible", TRUE,
+ "hscrollbar_policy", GTK_POLICY_AUTOMATIC,
+ "vscrollbar_policy", GTK_POLICY_ALWAYS,
+ "height_request", 120,
+ "border_width", 5,
+ "shadow_type", GTK_SHADOW_IN,
+ NULL);
gtk_paned_pack1 (GTK_PANED (paned), any, TRUE, TRUE);
- self->tree = g_object_new (GTK_TYPE_TREE_VIEW,
- "visible", TRUE,
- "can_focus", TRUE, /* FALSE, */
- "model", self->chunk_wrapper,
- "border_width", 10,
- "parent", any,
- NULL);
+ self->tree = (GtkWidget*) g_object_new (GTK_TYPE_TREE_VIEW,
+ "visible", TRUE,
+ "can_focus", TRUE, /* FALSE, */
+ "model", self->chunk_wrapper,
+ "border_width", 10,
+ "parent", any,
+ NULL);
gxk_nullify_in_object (self, &self->tree);
g_object_connect (self->tree, "swapped_object_signal::row_activated", tree_row_activated, self, NULL);
tsel = gtk_tree_view_get_selection (GTK_TREE_VIEW (self->tree));
@@ -173,11 +173,11 @@ bst_wave_editor_init (BstWaveEditor *self)
COL_FILE_NAME, "", 0.0, "FileName");
/* qsampler container */
- self->qsampler_parent = g_object_new (GTK_TYPE_VBOX,
- "visible", TRUE,
- "spacing", 1,
- "border_width", 0,
- NULL);
+ self->qsampler_parent = (GtkWidget*) g_object_new (GTK_TYPE_VBOX,
+ "visible", TRUE,
+ "spacing", 1,
+ "border_width", 0,
+ NULL);
gxk_nullify_in_object (self, &self->qsampler_parent);
gtk_paned_pack2 (GTK_PANED (paned), self->qsampler_parent, TRUE, TRUE);
@@ -190,26 +190,26 @@ bst_wave_editor_init (BstWaveEditor *self)
self->zoom_adjustment = GTK_ADJUSTMENT (gtk_adjustment_new (0.5, 1e-16, 1e+16, 0.1, 10, 0));
g_object_connect (self->zoom_adjustment, "swapped_signal_after::value_changed", adjustments_changed, self, NULL);
gxk_nullify_in_object (self, &self->zoom_adjustment);
- any = g_object_new (GTK_TYPE_SPIN_BUTTON,
- "adjustment", self->zoom_adjustment,
- "digits", 5,
- "visible", TRUE,
- NULL);
+ any = (GtkWidget*) g_object_new (GTK_TYPE_SPIN_BUTTON,
+ "adjustment", self->zoom_adjustment,
+ "digits", 5,
+ "visible", TRUE,
+ NULL);
gmask = bst_gmask_quick (self->gmask_parent, 0, _("Zoom:"), any, NULL);
/* qsampler vscale */
self->vscale_adjustment = GTK_ADJUSTMENT (gtk_adjustment_new (100, 1e-16, 1e+16, 1, 10, 0));
g_object_connect (self->vscale_adjustment, "swapped_signal_after::value_changed", adjustments_changed, self, NULL);
gxk_nullify_in_object (self, &self->vscale_adjustment);
- any = g_object_new (GTK_TYPE_SPIN_BUTTON,
- "adjustment", self->vscale_adjustment,
- "digits", 5,
- "visible", TRUE,
- NULL);
+ any = (GtkWidget*) g_object_new (GTK_TYPE_SPIN_BUTTON,
+ "adjustment", self->vscale_adjustment,
+ "digits", 5,
+ "visible", TRUE,
+ NULL);
gmask = bst_gmask_quick (self->gmask_parent, 1, _("VScale:"), any, NULL);
/* qsampler draw type choice */
- any = g_object_new (GTK_TYPE_OPTION_MENU, "visible", TRUE, NULL);
+ any = (GtkWidget*) g_object_new (GTK_TYPE_OPTION_MENU, "visible", TRUE, NULL);
gtk_option_menu_set_menu (GTK_OPTION_MENU (any),
bst_choice_menu_createv ("<BEAST-WaveEditor>/QSamplerDrawType",
BST_CHOICE (BST_QSAMPLER_DRAW_CRANGE, _("Shape Range"), NONE),
@@ -231,7 +231,7 @@ bst_wave_editor_init (BstWaveEditor *self)
self->playback_length = 0;
/* preview auto scroll choice */
- any = g_object_new (GTK_TYPE_OPTION_MENU, "visible", TRUE, NULL);
+ any = (GtkWidget*) g_object_new (GTK_TYPE_OPTION_MENU, "visible", TRUE, NULL);
gtk_option_menu_set_menu (GTK_OPTION_MENU (any),
bst_choice_menu_createv ("<BEAST-WaveEditor>/PreviewScrollType",
BST_CHOICE (SCROLL_NONE, _("Scroll None"), NONE),
@@ -245,19 +245,19 @@ bst_wave_editor_init (BstWaveEditor *self)
gmask = bst_gmask_quick (self->gmask_parent, 1, NULL, any, NULL);
/* preview buttons */
- any = g_object_new (GTK_TYPE_HBOX,
- "visible", TRUE,
- NULL);
+ any = (GtkWidget*) g_object_new (GTK_TYPE_HBOX,
+ "visible", TRUE,
+ NULL);
self->preview_on = gxk_stock_button_child (BST_STOCK_PREVIEW_AUDIO, "Start _Preview");
self->preview_off = gxk_stock_button_child (BST_STOCK_PREVIEW_NO_AUDIO, "Stop _Preview");
gtk_container_add (GTK_CONTAINER (any), self->preview_on);
gtk_container_add (GTK_CONTAINER (any), self->preview_off);
gxk_nullify_in_object (self, &self->preview_on);
gxk_nullify_in_object (self, &self->preview_off);
- any = g_object_new (GTK_TYPE_BUTTON,
- "visible", TRUE,
- "child", any,
- NULL);
+ any = (GtkWidget*) g_object_new (GTK_TYPE_BUTTON,
+ "visible", TRUE,
+ "child", any,
+ NULL);
g_object_connect (any, "swapped_signal::clicked", play_back_button_clicked, self, NULL);
gtk_widget_show (self->preview_on);
gtk_widget_hide (self->preview_off);
@@ -335,7 +335,7 @@ play_back_wchunk_off (BstWaveEditor *self)
if (self->preview_on)
gtk_widget_show (self->preview_on);
for (i = 0; i < self->n_qsamplers; i++)
- bst_qsampler_set_mark (self->qsamplers[i], 3, 0, 0);
+ bst_qsampler_set_mark (self->qsamplers[i], 3, 0, BstQSamplerType (0));
}
static void
@@ -343,7 +343,7 @@ update_play_back_marks (gpointer data,
SfiNum tick_stamp,
guint pcm_pos)
{
- BstWaveEditor *self = data;
+ BstWaveEditor *self = (BstWaveEditor*) data;
/* initial notify */
if (!self->tick_stamp || tick_stamp <= self->tick_stamp || pcm_pos <= self->pcm_pos)
@@ -373,8 +373,6 @@ update_play_back_marks (gpointer data,
play_back_wchunk_off (self); /* stop looping */
}
-guint64 bse_engine_tick_stamp_from_systime (guint64 systime); // FIXME
-
static gboolean
playback_marker (gpointer data)
{
@@ -397,8 +395,7 @@ playback_marker (gpointer data)
for (i = 0; i < self->n_qsamplers; i++)
{
BstQSampler *qsampler = self->qsamplers[i];
-
- bst_qsampler_set_mark (qsampler, 3, qpos, 0);
+ bst_qsampler_set_mark (qsampler, 3, qpos, BstQSamplerType (0));
bst_qsampler_force_refresh (qsampler);
switch (self->auto_scroll_mode)
{
@@ -473,12 +470,12 @@ wave_editor_set_n_qsamplers (BstWaveEditor *self,
/* playback position scale */
if (!self->qsampler_playpos && n_qsamplers)
{
- self->qsampler_playpos = g_object_new (GTK_TYPE_HSCALE,
- "visible", TRUE,
- "adjustment", gtk_adjustment_new (0, 0, 100, 1, 10, 0),
- "draw_value", FALSE,
- "can_focus", FALSE,
- NULL);
+ self->qsampler_playpos = (GtkWidget*) g_object_new (GTK_TYPE_HSCALE,
+ "visible", TRUE,
+ "adjustment", gtk_adjustment_new (0, 0, 100, 1, 10, 0),
+ "draw_value", FALSE,
+ "can_focus", FALSE,
+ NULL);
gxk_nullify_in_object (self, &self->qsampler_playpos);
gtk_box_pack_end (GTK_BOX (qsampler_parent), self->qsampler_playpos, FALSE, TRUE, 0);
g_object_connect (GTK_RANGE (self->qsampler_playpos)->adjustment,
@@ -504,7 +501,7 @@ wave_editor_set_n_qsamplers (BstWaveEditor *self,
/* create missing */
for (i = self->n_qsamplers; i < n_qsamplers; i++)
{
- BstQSampler *qsampler = g_object_new (BST_TYPE_QSAMPLER,
+ BstQSampler *qsampler = (BstQSampler*) g_object_new (BST_TYPE_QSAMPLER,
"visible", TRUE,
"parent", qsampler_parent,
"height_request", 80,
@@ -513,7 +510,7 @@ wave_editor_set_n_qsamplers (BstWaveEditor *self,
qsampler->owner = self;
qsampler->owner_index = i;
bst_qsampler_set_source (qsampler, 0, NULL, NULL, NULL);
- bst_qsampler_set_draw_mode (qsampler, self->draw_mode);
+ bst_qsampler_set_draw_mode (qsampler, BstQSamplerDrawMode (self->draw_mode));
self->qsamplers[i] = qsampler;
}
self->n_qsamplers = n_qsamplers;
@@ -558,7 +555,7 @@ bst_wave_editor_set_esample (BstWaveEditor *self,
for (i = 0; i < self->n_qsamplers; i++)
if (self->esample)
{
- bst_qsampler_set_mark (self->qsamplers[i], 3, 0, 0);
+ bst_qsampler_set_mark (self->qsamplers[i], 3, 0, BstQSamplerType (0));
bst_qsampler_set_source_from_esample (self->qsamplers[i], self->esample, i);
}
else
@@ -637,7 +634,7 @@ change_draw_mode (BstWaveEditor *self,
for (i = 0; i < self->n_qsamplers; i++)
{
BstQSampler *qsampler = self->qsamplers[i];
- bst_qsampler_set_draw_mode (qsampler, self->draw_mode);
+ bst_qsampler_set_draw_mode (qsampler, BstQSamplerDrawMode (self->draw_mode));
}
}
diff --git a/beast-gtk/bstwaveview.c b/beast-gtk/bstwaveview.cc
similarity index 94%
rename from beast-gtk/bstwaveview.c
rename to beast-gtk/bstwaveview.cc
index 0eedf0c..fca942a 100644
--- a/beast-gtk/bstwaveview.c
+++ b/beast-gtk/bstwaveview.cc
@@ -53,9 +53,9 @@ static const GxkStockAction wave_view_actions[] = {
G_DEFINE_TYPE (BstWaveView, bst_wave_view, BST_TYPE_ITEM_VIEW);
static void
-bst_wave_view_class_init (BstWaveViewClass *class)
+bst_wave_view_class_init (BstWaveViewClass *klass)
{
- BstItemViewClass *item_view_class = BST_ITEM_VIEW_CLASS (class);
+ BstItemViewClass *item_view_class = BST_ITEM_VIEW_CLASS (klass);
item_view_class->item_type = "BseWave";
}
@@ -70,7 +70,7 @@ bst_wave_view_init (BstWaveView *self)
G_N_ELEMENTS (wave_view_actions), wave_view_actions,
NULL, wave_view_action_check, wave_view_action_exec);
/* setup tree view */
- GtkTreeView *tview = gxk_radget_find (radget, "tree-view");
+ GtkTreeView *tview = (GtkTreeView*) gxk_radget_find (radget, "tree-view");
bst_item_view_complete_tree (iview, tview);
/* prime locals */
self->editable = TRUE;
@@ -96,8 +96,7 @@ popup_wave_dialog (BstWaveView *wave_view)
GtkWidget *weditor, *wdialog;
weditor = bst_wave_editor_new (wave);
- wdialog = gxk_dialog_new (NULL, GTK_OBJECT (wave_view), GXK_DIALOG_DELETE_BUTTON,
- NULL, weditor);
+ wdialog = (GtkWidget*) gxk_dialog_new (NULL, GTK_OBJECT (wave_view), GXK_DIALOG_DELETE_BUTTON, NULL, weditor);
bst_window_sync_title_to_proxy (GXK_DIALOG (wdialog), wave, "%s");
gtk_widget_show (wdialog);
}
diff --git a/beast-gtk/bstxframe.c b/beast-gtk/bstxframe.cc
similarity index 92%
rename from beast-gtk/bstxframe.c
rename to beast-gtk/bstxframe.cc
index a8228ed..29ee05d 100644
--- a/beast-gtk/bstxframe.c
+++ b/beast-gtk/bstxframe.cc
@@ -62,11 +62,11 @@ static guint signal_button_check = 0;
G_DEFINE_TYPE (BstXFrame, bst_xframe, GTK_TYPE_FRAME);
static void
-bst_xframe_class_init (BstXFrameClass *class)
+bst_xframe_class_init (BstXFrameClass *klass)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (class);
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
gobject_class->set_property = bst_xframe_set_property;
gobject_class->get_property = bst_xframe_get_property;
@@ -91,7 +91,7 @@ bst_xframe_class_init (BstXFrameClass *class)
FALSE,
G_PARAM_READWRITE));
signal_button_check = g_signal_new ("button_check",
- G_OBJECT_CLASS_TYPE (class),
+ G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (BstXFrameClass, button_check),
NULL, NULL,
@@ -132,7 +132,7 @@ bst_xframe_set_property (GObject *object,
switch (prop_id)
{
case PARAM_COVER:
- bst_xframe_set_cover_widget (xframe, g_value_get_object (value), xframe->steal_button);
+ bst_xframe_set_cover_widget (xframe, (GtkWidget*) g_value_get_object (value), xframe->steal_button);
break;
case PARAM_STEAL_BUTTON:
bst_xframe_set_cover_widget (xframe, xframe->cover, g_value_get_boolean (value));
@@ -351,11 +351,11 @@ bst_xframe_set_cover_widget (BstXFrame *xframe,
if (xframe->cover)
{
- g_signal_handlers_disconnect_by_func (xframe->cover, G_CALLBACK (bst_xframe_size_allocate_cover), xframe);
- g_signal_handlers_disconnect_by_func (xframe->cover, G_CALLBACK (bst_xframe_button_press), xframe);
- g_signal_handlers_disconnect_by_func (xframe->cover, G_CALLBACK (bst_xframe_button_release), xframe);
- g_signal_handlers_disconnect_by_func (xframe->cover, G_CALLBACK (bst_xframe_enter_notify), xframe);
- g_signal_handlers_disconnect_by_func (xframe->cover, G_CALLBACK (bst_xframe_leave_notify), xframe);
+ g_signal_handlers_disconnect_by_func (xframe->cover, (void*) bst_xframe_size_allocate_cover, xframe);
+ g_signal_handlers_disconnect_by_func (xframe->cover, (void*) bst_xframe_button_press, xframe);
+ g_signal_handlers_disconnect_by_func (xframe->cover, (void*) bst_xframe_button_release, xframe);
+ g_signal_handlers_disconnect_by_func (xframe->cover, (void*) bst_xframe_enter_notify, xframe);
+ g_signal_handlers_disconnect_by_func (xframe->cover, (void*) bst_xframe_leave_notify, xframe);
g_object_unref (xframe->cover);
}
xframe->cover = widget;
diff --git a/beast-gtk/bstxkb.c b/beast-gtk/bstxkb.cc
similarity index 98%
rename from beast-gtk/bstxkb.c
rename to beast-gtk/bstxkb.cc
index 9bc0cd0..935f56b 100644
--- a/beast-gtk/bstxkb.c
+++ b/beast-gtk/bstxkb.cc
@@ -174,7 +174,7 @@ bst_xkb_parse_symbol (const gchar *const_symbol,
gchar **layout_p,
gchar **variant_p)
{
- gchar *s, *e, *symbol = const_symbol ? (gchar*) const_symbol : "";
+ const char *s, *e, *symbol = const_symbol ? (gchar*) const_symbol : "";
e = symbol + strlen (symbol);
diff --git a/beast-gtk/bstzoomedwindow.c b/beast-gtk/bstzoomedwindow.cc
similarity index 90%
rename from beast-gtk/bstzoomedwindow.c
rename to beast-gtk/bstzoomedwindow.cc
index 12c2bd7..c4ada1a 100644
--- a/beast-gtk/bstzoomedwindow.c
+++ b/beast-gtk/bstzoomedwindow.cc
@@ -82,14 +82,14 @@ bst_zoomed_window_get_type (void)
}
static void
-bst_zoomed_window_class_init (BstZoomedWindowClass *class)
+bst_zoomed_window_class_init (BstZoomedWindowClass *klass)
{
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
- GtkContainerClass *container_class = GTK_CONTAINER_CLASS (class);
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+ GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
- bst_zoomed_window_class = class;
- parent_class = g_type_class_peek_parent (class);
+ bst_zoomed_window_class = klass;
+ parent_class = g_type_class_peek_parent (klass);
G_OBJECT_CLASS (object_class)->finalize = bst_zoomed_window_finalize;
@@ -102,7 +102,7 @@ bst_zoomed_window_class_init (BstZoomedWindowClass *class)
container_class->forall = bst_zoomed_window_forall;
- class->zoom = NULL;
+ klass->zoom = NULL;
zoomed_window_signals[SIGNAL_ZOOM] =
gtk_signal_new ("zoom",
@@ -124,12 +124,13 @@ bst_zoomed_window_init (BstZoomedWindow *zoomed_window)
gtk_scrolled_window_set_vadjustment (scrolled_window, NULL);
gtk_widget_push_composite_child ();
- zoomed_window->toggle_button = g_object_connect (gtk_widget_new (GTK_TYPE_TOGGLE_BUTTON,
- "visible", TRUE,
- "can_focus", FALSE,
- NULL),
- "swapped_signal::clicked", bst_zoomed_window_clicked, zoomed_window,
- NULL);
+ zoomed_window->toggle_button = gtk_widget_new (GTK_TYPE_TOGGLE_BUTTON,
+ "visible", TRUE,
+ "can_focus", FALSE,
+ NULL);
+ g_object_connect (zoomed_window->toggle_button,
+ "swapped_signal::clicked", bst_zoomed_window_clicked, zoomed_window,
+ NULL);
gtk_widget_set_parent (zoomed_window->toggle_button, GTK_WIDGET (zoomed_window));
gtk_widget_pop_composite_child ();
}
diff --git a/beast-gtk/gxk/gxkdialog.h b/beast-gtk/gxk/gxkdialog.h
index a8b6ac8..3ecd185 100644
--- a/beast-gtk/gxk/gxkdialog.h
+++ b/beast-gtk/gxk/gxkdialog.h
@@ -105,7 +105,7 @@ void gxk_dialog_clear_flags (GxkDialog *dialog,
GxkDialogFlags flags);
void gxk_dialog_remove_actions (GxkDialog *dialog);
#define gxk_dialog_action( dialog, action, callback, data) \
- gxk_dialog_action_multi ((dialog), (action), (callback), (data), 0, 0)
+ gxk_dialog_action_multi ((dialog), (action), (callback), (data), 0, (GxkDialogMultiFlags) 0)
#define gxk_dialog_default_action( dialog, action, callback, data) \
gxk_dialog_action_multi ((dialog), (action), (callback), (data), 0, GXK_DIALOG_MULTI_DEFAULT)
#define gxk_dialog_action_swapped( dialog, action, callback, data) \
@@ -136,6 +136,11 @@ inline GxkDialogFlags& operator&= (GxkDialogFlags &s1, GxkDialogFlags s2) { s1 =
inline GxkDialogFlags operator| (GxkDialogFlags s1, GxkDialogFlags s2) { return GxkDialogFlags (s1 | (long long unsigned) s2); }
inline GxkDialogFlags& operator|= (GxkDialogFlags &s1, GxkDialogFlags s2) { s1 = s1 | s2; return s1; }
inline GxkDialogFlags operator~ (GxkDialogFlags s1) { return GxkDialogFlags (~(long long unsigned) s1); }
+inline GxkDialogMultiFlags operator& (GxkDialogMultiFlags s1, GxkDialogMultiFlags s2) { return GxkDialogMultiFlags (s1 & (long long unsigned) s2); }
+inline GxkDialogMultiFlags& operator&= (GxkDialogMultiFlags &s1, GxkDialogMultiFlags s2) { s1 = s1 & s2; return s1; }
+inline GxkDialogMultiFlags operator| (GxkDialogMultiFlags s1, GxkDialogMultiFlags s2) { return GxkDialogMultiFlags (s1 | (long long unsigned) s2); }
+inline GxkDialogMultiFlags& operator|= (GxkDialogMultiFlags &s1, GxkDialogMultiFlags s2) { s1 = s1 | s2; return s1; }
+inline GxkDialogMultiFlags operator~ (GxkDialogMultiFlags s1) { return GxkDialogMultiFlags (~(long long unsigned) s1); }
#endif // __cplusplus
#endif /* __GXK_DIALOG_H__ */
diff --git a/beast-gtk/gxk/gxkglobals.h b/beast-gtk/gxk/gxkglobals.h
index eb9fdc0..e9e446f 100644
--- a/beast-gtk/gxk/gxkglobals.h
+++ b/beast-gtk/gxk/gxkglobals.h
@@ -81,6 +81,12 @@ inline GdkEventMask operator| (GdkEventMask s1, GdkEventMask s2) { return Gdk
inline GdkEventMask& operator|= (GdkEventMask &s1, GdkEventMask s2) { s1 = s1 | s2; return s1; }
inline GdkEventMask operator~ (GdkEventMask s1) { return GdkEventMask (~(long long unsigned) s1); }
+inline GdkModifierType operator& (GdkModifierType s1, GdkModifierType s2) { return GdkModifierType (s1 & (long long unsigned) s2); }
+inline GdkModifierType& operator&= (GdkModifierType &s1, GdkModifierType s2) { s1 = s1 & s2; return s1; }
+inline GdkModifierType operator| (GdkModifierType s1, GdkModifierType s2) { return GdkModifierType (s1 | (long long unsigned) s2); }
+inline GdkModifierType& operator|= (GdkModifierType &s1, GdkModifierType s2) { s1 = s1 | s2; return s1; }
+inline GdkModifierType operator~ (GdkModifierType s1) { return GdkModifierType (~(long long unsigned) s1); }
+
inline GdkWindowHints operator& (GdkWindowHints s1, GdkWindowHints s2) { return GdkWindowHints (s1 & (long long unsigned) s2); }
inline GdkWindowHints& operator&= (GdkWindowHints &s1, GdkWindowHints s2) { s1 = s1 & s2; return s1; }
inline GdkWindowHints operator| (GdkWindowHints s1, GdkWindowHints s2) { return GdkWindowHints (s1 | (long long unsigned) s2); }
diff --git a/beast-gtk/gxk/gxktexttools.h b/beast-gtk/gxk/gxktexttools.h
index 781408b..52cd636 100644
--- a/beast-gtk/gxk/gxktexttools.h
+++ b/beast-gtk/gxk/gxktexttools.h
@@ -106,4 +106,13 @@ void gxk_text_buffer_add_textgets_to_view (GtkTextBuffer *tbuffer,
G_END_DECLS
+// == Flags Enumeration Operators in C++ ==
+#ifdef __cplusplus
+inline GxkScrollTextFlags operator& (GxkScrollTextFlags s1, GxkScrollTextFlags s2) { return GxkScrollTextFlags (s1 & (long long unsigned) s2); }
+inline GxkScrollTextFlags& operator&= (GxkScrollTextFlags &s1, GxkScrollTextFlags s2) { s1 = s1 & s2; return s1; }
+inline GxkScrollTextFlags operator| (GxkScrollTextFlags s1, GxkScrollTextFlags s2) { return GxkScrollTextFlags (s1 | (long long unsigned) s2); }
+inline GxkScrollTextFlags& operator|= (GxkScrollTextFlags &s1, GxkScrollTextFlags s2) { s1 = s1 | s2; return s1; }
+inline GxkScrollTextFlags operator~ (GxkScrollTextFlags s1) { return GxkScrollTextFlags (~(long long unsigned) s1); }
+#endif // __cplusplus
+
#endif /* __GXK_TEXT_TOOLS_H__ */
diff --git a/beast-gtk/testgui.c b/beast-gtk/testgui.cc
similarity index 84%
rename from beast-gtk/testgui.c
rename to beast-gtk/testgui.cc
index e4d3fae..bc79a9e 100644
--- a/beast-gtk/testgui.c
+++ b/beast-gtk/testgui.cc
@@ -18,6 +18,9 @@
#include "bstutils.h"
#include "bse/bse.h"
#include "bstdbmeter.h"
+#include "bstparam.h"
+#include "bstgconfig.h"
+#include "bstskinconfig.h"
/* --- FIXME: --- */
gboolean bst_developer_hints = FALSE;
@@ -71,14 +74,14 @@ build_db_meter_test (GtkBox *box)
{
GtkWidget *meter;
meter = bst_db_meter_new (GTK_ORIENTATION_HORIZONTAL, 1);
- bst_db_beam_set_value (bst_db_meter_get_beam (meter, 0), G_MAXDOUBLE);
+ bst_db_beam_set_value (bst_db_meter_get_beam ((BstDBMeter*) meter, 0), G_MAXDOUBLE);
gtk_box_pack_start (box, meter, TRUE, TRUE, 5);
meter = create_db_meter (GTK_ORIENTATION_VERTICAL);
gtk_box_pack_start (box, meter, TRUE, TRUE, 5);
meter = create_db_meter (GTK_ORIENTATION_HORIZONTAL);
gtk_box_pack_start (box, meter, FALSE, TRUE, 5);
meter = bst_db_meter_new (GTK_ORIENTATION_VERTICAL, 2);
- bst_db_beam_set_value (bst_db_meter_get_beam (meter, 1), G_MAXDOUBLE);
+ bst_db_beam_set_value (bst_db_meter_get_beam ((BstDBMeter*) meter, 1), G_MAXDOUBLE);
gtk_box_pack_start (box, meter, TRUE, TRUE, 5);
}
@@ -123,9 +126,7 @@ main (int argc,
_bst_skin_config_init ();
/* start BSE core and connect */
- SfiRec *bseconfig = sfi_rec_new ();
- bse_init_async (&argc, &argv, "TestGUI", bseconfig);
- sfi_rec_unref (bseconfig);
+ bse_init_async (&argc, &argv, "TestGUI", NULL);
sfi_glue_context_push (bse_init_glue_context ("TestGUI"));
GSource *source = g_source_simple (G_PRIORITY_HIGH - 100,
(GSourcePending) sfi_glue_context_pending,
@@ -134,19 +135,19 @@ main (int argc,
g_source_attach (source, NULL);
g_source_unref (source);
- GtkWidget *dialog = gxk_dialog_new (NULL, NULL, GXK_DIALOG_DELETE_BUTTON, "Test Window", NULL);
+ GtkWidget *dialog = (GtkWidget*) gxk_dialog_new (NULL, NULL, GXK_DIALOG_DELETE_BUTTON, "Test Window", NULL);
g_object_connect (dialog, "signal::destroy", gtk_main_quit, NULL, NULL);
g_object_set (dialog,
"default_width", 25, // 560,
"default_height", 25, // 640,
NULL);
- GtkWidget *box = g_object_new (GTK_TYPE_VBOX, "visible", TRUE, NULL);
+ GtkWidget *box = (GtkWidget*) g_object_new (GTK_TYPE_VBOX, "visible", TRUE, NULL);
gxk_dialog_set_child (GXK_DIALOG (dialog),
- g_object_new (GTK_TYPE_ALIGNMENT,
- "visible", TRUE,
- "border_width", 10,
- "child", box,
- NULL));
+ (GtkWidget*) g_object_new (GTK_TYPE_ALIGNMENT,
+ "visible", TRUE,
+ "border_width", 10,
+ "child", box,
+ NULL));
build_db_meter_test (GTK_BOX (box));
diff --git a/beast-gtk/tsmview.c b/beast-gtk/tsmview.cc
similarity index 87%
rename from beast-gtk/tsmview.c
rename to beast-gtk/tsmview.cc
index 650e202..8aacf15 100644
--- a/beast-gtk/tsmview.c
+++ b/beast-gtk/tsmview.cc
@@ -29,10 +29,10 @@ textget_handler (gpointer user_data,
const gchar **attribute_names,
const gchar **attribute_values)
{
- return g_object_new (GTK_TYPE_LABEL,
- "visible", TRUE,
- "label", element_name,
- NULL);
+ return (GtkWidget*) g_object_new (GTK_TYPE_LABEL,
+ "visible", TRUE,
+ "label", element_name,
+ NULL);
}
int
@@ -41,8 +41,8 @@ main (int argc,
{
GtkWidget *sctext, *dialog;
gchar *str, *title = NULL;
- guint i, flags = 0;
-
+ uint i;
+ GxkScrollTextFlags flags = GxkScrollTextFlags (0);
/* initialize modules
*/
g_type_init ();
@@ -81,12 +81,12 @@ main (int argc,
title = g_strconcat (title, " ", argv[i], NULL);
g_free (str);
}
-
+
str = title;
title = g_strdup ("tsmview"); // g_strconcat (title, " - tsmview", NULL);
g_free (str);
- dialog = gxk_dialog_new (NULL, NULL, GXK_DIALOG_DELETE_BUTTON, title, NULL);
+ dialog = (GtkWidget*) gxk_dialog_new (NULL, NULL, GXK_DIALOG_DELETE_BUTTON, title, NULL);
g_free (title);
g_object_connect (dialog, "signal::destroy", gtk_main_quit, NULL, NULL);
diff --git a/po/POTSCAN b/po/POTSCAN
index d91f0f9..cd1c9bb 100644
--- a/po/POTSCAN
+++ b/po/POTSCAN
@@ -1,56 +1,57 @@
#0 List of source files to scan for translatable strings
#0 Please keep alphabetically sorted
-beast-gtk/bstapp.c
-beast-gtk/bstauxdialogs.c
-beast-gtk/bstbuseditor.c
-beast-gtk/bstbusmixer.c
-beast-gtk/bstbusview.c
-beast-gtk/bstcanvaslink.c
-beast-gtk/bstcanvassource.c
-beast-gtk/bstdbmeter.c
-beast-gtk/bsteventrollctrl.c
-beast-gtk/bstfiledialog.c
-beast-gtk/bstgrowbar.c
-beast-gtk/bstitemseqdialog.c
-beast-gtk/bstitemview.c
-beast-gtk/bstkeybindings.c
-beast-gtk/bstmain.c
-beast-gtk/bstmsgabsorb.c
-beast-gtk/bstparam-automation.c
-beast-gtk/bstparam-choice.c
-beast-gtk/bstparam-color-spinner.c
-beast-gtk/bstparam-item-seq.c
-beast-gtk/bstparam-note-sequence.c
-beast-gtk/bstparam-note-spinner.c
-beast-gtk/bstparam-proxy.c
-beast-gtk/bstparam-scale.c
-beast-gtk/bstparam-searchpath.c
-beast-gtk/bstparam-time.c
-beast-gtk/bstpartdialog.c
-beast-gtk/bstpartview.c
-beast-gtk/bstpatterncolumns.c
-beast-gtk/bstpatternctrl.c
-beast-gtk/bstpianorollctrl.c
-beast-gtk/bstplayback.c
-beast-gtk/bstpreferences.c
-beast-gtk/bstprocedure.c
-beast-gtk/bstprofiler.c
-beast-gtk/bstprojectctrl.c
-beast-gtk/bstrackeditor.c
-beast-gtk/bstrackitem.c
-beast-gtk/bstrackview.c
+beast-gtk/bstapp.cc
+beast-gtk/bstauxdialogs.cc
+beast-gtk/bstbuseditor.cc
+beast-gtk/bstbusmixer.cc
+beast-gtk/bstbusview.cc
+beast-gtk/bstcanvaslink.cc
+beast-gtk/bstcanvassource.cc
+beast-gtk/bstdbmeter.cc
+beast-gtk/bsteventrollctrl.cc
+beast-gtk/bstfiledialog.cc
+beast-gtk/bstgrowbar.cc
+beast-gtk/bstitemseqdialog.cc
+beast-gtk/bstitemview.cc
+beast-gtk/bstkeybindings.cc
+beast-gtk/bstmain.cc
+beast-gtk/bstmsgabsorb.cc
+beast-gtk/bstparam-automation.cc
+beast-gtk/bstparam-choice.cc
+beast-gtk/bstparam-color-spinner.cc
+beast-gtk/bstparam-item-seq.cc
+beast-gtk/bstparam-note-sequence.cc
+beast-gtk/bstparam-note-spinner.cc
+beast-gtk/bstparam-proxy.cc
+beast-gtk/bstparam-scale.cc
+beast-gtk/bstparam-searchpath.cc
+beast-gtk/bstparam-time.cc
+beast-gtk/bstpartdialog.cc
+beast-gtk/bstpartview.cc
+beast-gtk/bstpatterncolumns.cc
+beast-gtk/bstpatternctrl.cc
+beast-gtk/bstpianorollctrl.cc
+beast-gtk/bstplayback.cc
+beast-gtk/bstpreferences.cc
+beast-gtk/bstprocedure.cc
+beast-gtk/bstprofiler.cc
+beast-gtk/bstprojectctrl.cc
+beast-gtk/bstrackeditor.cc
+beast-gtk/bstrackitem.cc
+beast-gtk/bstrackview.cc
beast-gtk/bstrecords.idl
-beast-gtk/bstsampleeditor.c
-beast-gtk/bstscrollgraph.c
-beast-gtk/bstsnetrouter.c
-beast-gtk/bstsupershell.c
-beast-gtk/bsttrackrollctrl.c
-beast-gtk/bsttracksynthdialog.c
-beast-gtk/bsttrackview.c
-beast-gtk/bstusermessage.c
-beast-gtk/bstutils.c
-beast-gtk/bstwaveeditor.c
-beast-gtk/bstwaveview.c
+beast-gtk/bstsampleeditor.cc
+beast-gtk/bstscrollgraph.cc
+beast-gtk/bstsnetrouter.cc
+beast-gtk/bststest.cc
+beast-gtk/bstsupershell.cc
+beast-gtk/bsttrackrollctrl.cc
+beast-gtk/bsttracksynthdialog.cc
+beast-gtk/bsttrackview.cc
+beast-gtk/bstusermessage.cc
+beast-gtk/bstutils.cc
+beast-gtk/bstwaveeditor.cc
+beast-gtk/bstwaveview.cc
beast-gtk/dialogs/radgets-beast.xml
beast-gtk/dialogs/radgets-standard.xml
beast-gtk/gxk/gxklistwrapper.cc
@@ -106,8 +107,8 @@ bse/bsewaveosc.cc
data/beast.desktop.in
data/beast.xml.in
data/bse.keys.in
-drivers/bsepcmdevice-alsa.cc
drivers/bsemididevice-alsa.cc
+drivers/bsepcmdevice-alsa.cc
library/scripts/mixer-splitup-by-track.scm
library/scripts/modules2grid.scm
library/scripts/part-harmonic-transposer.scm
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]