diff options
-rw-r--r-- | .settings/language.settings.xml | 4 | ||||
-rw-r--r-- | glade/main.glade | 373 | ||||
-rw-r--r-- | glade/settings.glade | 229 | ||||
-rw-r--r-- | src/mandelbrot-zoom.c | 103 | ||||
-rw-r--r-- | src/mandelbrot-zoom.h | 31 | ||||
-rw-r--r-- | src/settings.h | 7 |
6 files changed, 318 insertions, 429 deletions
diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml index 4ffde01..76dd30c 100644 --- a/.settings/language.settings.xml +++ b/.settings/language.settings.xml @@ -5,7 +5,7 @@ <provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/> <provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/> <provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/> - <provider class="org.eclipse.cdt.managedbuilder.internal.language.settings.providers.GCCBuiltinSpecsDetectorMinGW" console="false" env-hash="-1807341598710823991" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetectorMinGW" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings MinGW" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true"> + <provider class="org.eclipse.cdt.managedbuilder.internal.language.settings.providers.GCCBuiltinSpecsDetectorMinGW" console="false" env-hash="96421241988909923" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetectorMinGW" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings MinGW" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true"> <language-scope id="org.eclipse.cdt.core.gcc"/> <language-scope id="org.eclipse.cdt.core.g++"/> </provider> @@ -16,7 +16,7 @@ <provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/> <provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/> <provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/> - <provider class="org.eclipse.cdt.managedbuilder.internal.language.settings.providers.GCCBuiltinSpecsDetectorMinGW" console="false" env-hash="-1807341598710823991" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetectorMinGW" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings MinGW" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true"> + <provider class="org.eclipse.cdt.managedbuilder.internal.language.settings.providers.GCCBuiltinSpecsDetectorMinGW" console="false" env-hash="96421241988909923" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetectorMinGW" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings MinGW" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true"> <language-scope id="org.eclipse.cdt.core.gcc"/> <language-scope id="org.eclipse.cdt.core.g++"/> </provider> diff --git a/glade/main.glade b/glade/main.glade deleted file mode 100644 index 0457784..0000000 --- a/glade/main.glade +++ /dev/null @@ -1,373 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<interface> - <requires lib="gtk+" version="2.24"/> - <!-- interface-naming-policy project-wide --> - <object class="GtkWindow" id="settings"> - <property name="can_focus">False</property> - <property name="resizable">False</property> - <property name="default_width">300</property> - <property name="default_height">300</property> - <child> - <object class="GtkVBox" id="vbox1"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <child> - <object class="GtkFrame" id="videoFrame"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label_xalign">0</property> - <child> - <object class="GtkAlignment" id="alignment1"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="left_padding">12</property> - <child> - <object class="GtkVBox" id="vbox2"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <child> - <object class="GtkCheckButton" id="exportCb"> - <property name="label" translatable="yes">Export to file</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="draw_indicator">True</property> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkFrame" id="filetypeFrame"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label_xalign">0</property> - <property name="shadow_type">none</property> - <child> - <object class="GtkAlignment" id="alignment3"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="left_padding">12</property> - <child> - <object class="GtkRadioButton" id="gifRd"> - <property name="label" translatable="yes">GIF</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="active">True</property> - <property name="draw_indicator">True</property> - </object> - </child> - </object> - </child> - <child type="label"> - <object class="GtkLabel" id="filetypeLbl"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">File type</property> - <property name="use_markup">True</property> - </object> - </child> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - <child> - <object class="GtkFileChooserButton" id="fileChooser"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="title" translatable="yes">Choose export file</property> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">2</property> - </packing> - </child> - <child> - <object class="GtkTable" id="table2"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="n_rows">5</property> - <property name="n_columns">2</property> - <child> - <object class="GtkLabel" id="widthLbl"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">Render width</property> - </object> - </child> - <child> - <object class="GtkLabel" id="heightLbl"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">Render height</property> - </object> - <packing> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="fpsRenderLbl"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">Render FPS</property> - </object> - <packing> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="fpsVideoLbl"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">Video FPS</property> - </object> - <packing> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="bitrateLbl"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">Video bitrate (kbit/s)</property> - </object> - <packing> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - </packing> - </child> - <child> - <object class="GtkSpinButton" id="widthSp"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="invisible_char">●</property> - <property name="primary_icon_activatable">False</property> - <property name="secondary_icon_activatable">False</property> - <property name="primary_icon_sensitive">True</property> - <property name="secondary_icon_sensitive">True</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - </packing> - </child> - <child> - <object class="GtkSpinButton" id="heightSp"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="invisible_char">●</property> - <property name="primary_icon_activatable">False</property> - <property name="secondary_icon_activatable">False</property> - <property name="primary_icon_sensitive">True</property> - <property name="secondary_icon_sensitive">True</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - </packing> - </child> - <child> - <object class="GtkSpinButton" id="fpsRenderSp"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="invisible_char">●</property> - <property name="primary_icon_activatable">False</property> - <property name="secondary_icon_activatable">False</property> - <property name="primary_icon_sensitive">True</property> - <property name="secondary_icon_sensitive">True</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - </packing> - </child> - <child> - <object class="GtkSpinButton" id="fpsVideoSp"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="invisible_char">●</property> - <property name="primary_icon_activatable">False</property> - <property name="secondary_icon_activatable">False</property> - <property name="primary_icon_sensitive">True</property> - <property name="secondary_icon_sensitive">True</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - </packing> - </child> - <child> - <object class="GtkSpinButton" id="bitrateSp"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="invisible_char">●</property> - <property name="primary_icon_activatable">False</property> - <property name="secondary_icon_activatable">False</property> - <property name="primary_icon_sensitive">True</property> - <property name="secondary_icon_sensitive">True</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - </packing> - </child> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">3</property> - </packing> - </child> - </object> - </child> - </object> - </child> - <child type="label"> - <object class="GtkLabel" id="videoLbl"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">Video settings</property> - <property name="use_markup">True</property> - </object> - </child> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkFrame" id="controlsFrame"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label_xalign">0</property> - <child> - <object class="GtkAlignment" id="alignment2"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="left_padding">12</property> - <child> - <object class="GtkTable" id="table1"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="n_rows">2</property> - <property name="n_columns">2</property> - <child> - <object class="GtkLabel" id="inLbl"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">Zoom in</property> - </object> - </child> - <child> - <object class="GtkLabel" id="outLbl"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">Zoom out</property> - </object> - <packing> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - </packing> - </child> - <child> - <object class="GtkComboBoxText" id="inCombo"> - <property name="visible">True</property> - <property name="can_focus">False</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - </packing> - </child> - <child> - <object class="GtkComboBoxText" id="outCombo"> - <property name="visible">True</property> - <property name="can_focus">False</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - </packing> - </child> - </object> - </child> - </object> - </child> - <child type="label"> - <object class="GtkLabel" id="controlsLbl"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">Control settings</property> - <property name="use_markup">True</property> - </object> - </child> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - <child> - <object class="GtkHBox" id="hbox1"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <child> - <object class="GtkButton" id="startBtn"> - <property name="label" translatable="yes">Start</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkButton" id="exitBtn"> - <property name="label" translatable="yes">Exit</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">2</property> - </packing> - </child> - </object> - </child> - </object> -</interface> diff --git a/glade/settings.glade b/glade/settings.glade index 10affe9..52029c8 100644 --- a/glade/settings.glade +++ b/glade/settings.glade @@ -2,6 +2,74 @@ <interface> <requires lib="gtk+" version="2.24"/> <!-- interface-naming-policy project-wide --> + <object class="GtkColorSelectionDialog" id="colorDialog"> + <property name="can_focus">False</property> + <property name="border_width">5</property> + <property name="type_hint">dialog</property> + <child internal-child="color_selection"> + <object class="GtkColorSelection" id="colorsel-color_selection1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="current_color">#000000000000</property> + <child> + <object class="GtkLabel" id="colorStatus"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Select a color</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + <action-widgets> + <action-widget response="0">colorsel-help_button1</action-widget> + <action-widget response="0">colorsel-cancel_button1</action-widget> + <action-widget response="0">colorsel-ok_button1</action-widget> + </action-widgets> + <child internal-child="help_button"> + <object class="GtkButton" id="colorsel-help_button1"> + <property name="label" translatable="yes">button</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + </object> + </child> + <action-widgets> + <action-widget response="0">colorsel-help_button1</action-widget> + <action-widget response="0">colorsel-cancel_button1</action-widget> + <action-widget response="0">colorsel-ok_button1</action-widget> + </action-widgets> + <child internal-child="cancel_button"> + <object class="GtkButton" id="colorsel-cancel_button1"> + <property name="label" translatable="yes">button</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + </object> + </child> + <action-widgets> + <action-widget response="0">colorsel-help_button1</action-widget> + <action-widget response="0">colorsel-cancel_button1</action-widget> + <action-widget response="0">colorsel-ok_button1</action-widget> + </action-widgets> + <child internal-child="ok_button"> + <object class="GtkButton" id="colorsel-ok_button1"> + <property name="label" translatable="yes">button</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + </object> + </child> + <action-widgets> + <action-widget response="0">colorsel-help_button1</action-widget> + <action-widget response="0">colorsel-cancel_button1</action-widget> + <action-widget response="0">colorsel-ok_button1</action-widget> + </action-widgets> + </object> <object class="GtkWindow" id="settings"> <property name="can_focus">False</property> <property name="resizable">False</property> @@ -12,6 +80,159 @@ <property name="visible">True</property> <property name="can_focus">False</property> <child> + <object class="GtkFrame" id="generalFrame"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <child> + <object class="GtkAlignment" id="alignment4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="GtkTable" id="table3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="n_rows">2</property> + <property name="n_columns">2</property> + <property name="homogeneous">True</property> + <child> + <object class="GtkLabel" id="iterationsLbl"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Max. iterations</property> + </object> + </child> + <child> + <object class="GtkSpinButton" id="iterationsSp"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">●</property> + <property name="primary_icon_activatable">False</property> + <property name="secondary_icon_activatable">False</property> + <property name="primary_icon_sensitive">True</property> + <property name="secondary_icon_sensitive">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + </packing> + </child> + <child> + <object class="GtkHBox" id="hbox2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkHBox" id="hbox3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkLabel" id="colorFromLbl"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">from</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="colorFromBtn"> + <property name="label" translatable="yes">Select...</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkHBox" id="hbox4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkLabel" id="colorToLbl"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">to</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="colorToBtn"> + <property name="label" translatable="yes">Select...</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="colorLbl"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Color (from < to)</property> + </object> + <packing> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="generalLbl"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">General settings</property> + <property name="use_markup">True</property> + </object> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> <object class="GtkFrame" id="videoFrame"> <property name="visible">True</property> <property name="can_focus">False</property> @@ -44,7 +265,6 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="label_xalign">0</property> - <property name="shadow_type">none</property> <child> <object class="GtkAlignment" id="alignment3"> <property name="visible">True</property> @@ -235,6 +455,7 @@ <property name="can_focus">True</property> <property name="invisible_char">●</property> <property name="text" translatable="yes">C:\path\to\file.format</property> + <property name="invisible_char_set">True</property> <property name="primary_icon_activatable">False</property> <property name="secondary_icon_activatable">False</property> <property name="primary_icon_sensitive">True</property> @@ -270,7 +491,7 @@ <packing> <property name="expand">True</property> <property name="fill">True</property> - <property name="position">0</property> + <property name="position">1</property> </packing> </child> <child> @@ -345,7 +566,7 @@ <packing> <property name="expand">True</property> <property name="fill">True</property> - <property name="position">1</property> + <property name="position">2</property> </packing> </child> <child> @@ -382,7 +603,7 @@ <packing> <property name="expand">True</property> <property name="fill">True</property> - <property name="position">2</property> + <property name="position">3</property> </packing> </child> </object> diff --git a/src/mandelbrot-zoom.c b/src/mandelbrot-zoom.c index 4f23696..7aecae4 100644 --- a/src/mandelbrot-zoom.c +++ b/src/mandelbrot-zoom.c @@ -14,37 +14,47 @@ int main(int argc, char **argv) builder = gtk_builder_new(); gtk_builder_add_from_file (builder, "C:/Users/Superleo1810/eclipse-workspace/mandelbrot-zoom/glade/settings.glade", NULL); // gtk = zu behindert fr relative pfade - ui.settings = GTK_WIDGET(gtk_builder_get_object(builder, "settings")); + ui.settings = GTK_WINDOW(gtk_builder_get_object(builder, "settings")); //gtk_builder_connect_signals(builder, NULL); - ui.exportCb = GTK_WIDGET(gtk_builder_get_object(builder, "exportCb")); - ui.gifRd = GTK_WIDGET(gtk_builder_get_object(builder, "gifRd")); - ui.widthSp = GTK_WIDGET(gtk_builder_get_object(builder, "widthSp")); - ui.heightSp = GTK_WIDGET(gtk_builder_get_object(builder, "heightSp")); - ui.fpsRenderSp = GTK_WIDGET(gtk_builder_get_object(builder, "fpsRenderSp")); - ui.fpsVideoSp = GTK_WIDGET(gtk_builder_get_object(builder, "fpsVideoSp")); - ui.bitrateSp = GTK_WIDGET(gtk_builder_get_object(builder, "bitrateSp")); - ui.exportTf = GTK_WIDGET(gtk_builder_get_object(builder, "exportTf")); - ui.startBtn = GTK_WIDGET(gtk_builder_get_object(builder, "startBtn")); - ui.exitBtn = GTK_WIDGET(gtk_builder_get_object(builder, "exitBtn")); - - gtk_spin_button_set_increments((GtkSpinButton *)ui.widthSp, 1, 2); - gtk_spin_button_set_increments((GtkSpinButton *)ui.heightSp, 1, 2); - gtk_spin_button_set_increments((GtkSpinButton *)ui.fpsRenderSp, 1, 2); - gtk_spin_button_set_increments((GtkSpinButton *)ui.fpsVideoSp, 1, 2); - gtk_spin_button_set_increments((GtkSpinButton *)ui.bitrateSp, 1, 2); - - gtk_spin_button_set_value((GtkSpinButton *)ui.widthSp, 1920); - gtk_spin_button_set_value((GtkSpinButton *)ui.heightSp, 1080); - gtk_spin_button_set_value((GtkSpinButton *)ui.fpsRenderSp, 30); - gtk_spin_button_set_value((GtkSpinButton *)ui.fpsVideoSp, 30); - gtk_spin_button_set_value((GtkSpinButton *)ui.bitrateSp, 1000); - - gtk_spin_button_set_range((GtkSpinButton *)ui.widthSp, 1, 1920); - gtk_spin_button_set_range((GtkSpinButton *)ui.heightSp, 1, 1080); - gtk_spin_button_set_range((GtkSpinButton *)ui.fpsRenderSp, 1, 60); - gtk_spin_button_set_range((GtkSpinButton *)ui.fpsVideoSp, 1, 60); - gtk_spin_button_set_range((GtkSpinButton *)ui.bitrateSp, 1, 65535); - + ui.iterationsSp = GTK_SPIN_BUTTON(gtk_builder_get_object(builder, "iterationsSp")); + ui.colorFromBtn = GTK_BUTTON(gtk_builder_get_object(builder, "colorFromBtn")); + ui.colorToBtn = GTK_BUTTON(gtk_builder_get_object(builder, "colorToBtn")); + ui.exportCb = GTK_CHECK_BUTTON(gtk_builder_get_object(builder, "exportCb")); + ui.gifRd = GTK_RADIO_BUTTON(gtk_builder_get_object(builder, "gifRd")); + ui.widthSp = GTK_SPIN_BUTTON(gtk_builder_get_object(builder, "widthSp")); + ui.heightSp = GTK_SPIN_BUTTON(gtk_builder_get_object(builder, "heightSp")); + ui.fpsRenderSp = GTK_SPIN_BUTTON(gtk_builder_get_object(builder, "fpsRenderSp")); + ui.fpsVideoSp = GTK_SPIN_BUTTON(gtk_builder_get_object(builder, "fpsVideoSp")); + ui.bitrateSp = GTK_SPIN_BUTTON(gtk_builder_get_object(builder, "bitrateSp")); + ui.exportTf = GTK_ENTRY(gtk_builder_get_object(builder, "exportTf")); + ui.startBtn = GTK_BUTTON(gtk_builder_get_object(builder, "startBtn")); + ui.exitBtn = GTK_BUTTON(gtk_builder_get_object(builder, "exitBtn")); + ui.colorDialog = GTK_COLOR_SELECTION_DIALOG(gtk_builder_get_object(builder, "colorDialog")); + + gtk_spin_button_set_increments(ui.iterationsSp, 1, 2); + gtk_spin_button_set_increments(ui.widthSp, 1, 2); + gtk_spin_button_set_increments(ui.heightSp, 1, 2); + gtk_spin_button_set_increments(ui.fpsRenderSp, 1, 2); + gtk_spin_button_set_increments(ui.fpsVideoSp, 1, 2); + gtk_spin_button_set_increments(ui.bitrateSp, 1, 2); + + gtk_spin_button_set_value(ui.iterationsSp, 1000); + gtk_spin_button_set_value(ui.widthSp, 1920); + gtk_spin_button_set_value(ui.heightSp, 1080); + gtk_spin_button_set_value(ui.fpsRenderSp, 30); + gtk_spin_button_set_value(ui.fpsVideoSp, 30); + gtk_spin_button_set_value(ui.bitrateSp, 1000); + + gtk_spin_button_set_range(ui.iterationsSp, 1, 16777215); // 3 bytes 8 bit = 24 bit + gtk_spin_button_set_range(ui.widthSp, 1, 1920); + gtk_spin_button_set_range(ui.heightSp, 1, 1080); + gtk_spin_button_set_range(ui.fpsRenderSp, 1, 60); + gtk_spin_button_set_range(ui.fpsVideoSp, 1, 60); + gtk_spin_button_set_range(ui.bitrateSp, 1, 65535); + + g_signal_connect(ui.iterationsSp, "value-changed", G_CALLBACK(on_iterationsSp_valueChanged), NULL); + g_signal_connect(ui.colorFromBtn, "clicked", G_CALLBACK(on_colorFromBtn_clicked), NULL); + g_signal_connect(ui.colorToBtn, "clicked", G_CALLBACK(on_colorToBtn_clicked), NULL); g_signal_connect(ui.exportCb, "toggled", G_CALLBACK(on_exportCb_toggled), NULL); g_signal_connect(ui.widthSp, "value-changed", G_CALLBACK(on_widthSp_valueChanged), NULL); g_signal_connect(ui.heightSp, "value-changed", G_CALLBACK(on_heightSp_valueChanged), NULL); @@ -56,44 +66,61 @@ int main(int argc, char **argv) g_signal_connect(ui.exitBtn, "clicked", G_CALLBACK(on_exitBtn_clicked), NULL); g_object_unref(builder); - gtk_widget_show(ui.settings); + gtk_widget_show(GTK_WIDGET(ui.settings)); gtk_main(); return 0; } +void on_iterationsSp_valueChanged() +{ + config.iterations = gtk_spin_button_get_value(ui.widthSp); +} + +void on_colorFromBtn_clicked() +{ + currentColor = COLOR_FROM; + gtk_dialog_run(ui.colorDialog); +} + +void on_colorToBtn_clicked() +{ + currentColor = COLOR_TO; + gtk_dialog_run(ui.colorDialog); +} + void on_exportCb_toggled() { - config.video = gtk_toggle_button_get_active((GtkToggleButton *)ui.exportCb); + config.video = gtk_toggle_button_get_active(ui.exportCb); } void on_exportTf_changed() { - config.path = CHAR_PTR(gtk_entry_get_text((GtkEntry *)ui.exportTf)); + config.path = CHAR_PTR(gtk_entry_get_text(ui.exportTf)); } void on_widthSp_valueChanged() { - config.width = gtk_spin_button_get_value((GtkSpinButton *)ui.widthSp); + config.width = gtk_spin_button_get_value(ui.widthSp); } void on_heightSp_valueChanged() { - config.height = gtk_spin_button_get_value((GtkSpinButton *)ui.heightSp); + config.height = gtk_spin_button_get_value(ui.heightSp); } void on_fpsRenderSp_valueChanged() { - config.renderFPS = gtk_spin_button_get_value((GtkSpinButton *)ui.fpsRenderSp); + config.renderFPS = gtk_spin_button_get_value(ui.fpsRenderSp); } void on_fpsVideoSp_valueChanged() { - config.videoFPS = gtk_spin_button_get_value((GtkSpinButton *)ui.fpsVideoSp); + config.videoFPS = gtk_spin_button_get_value(ui.fpsVideoSp); } void on_bitrateSp_valueChanged() { - config.bitrate = gtk_spin_button_get_value((GtkSpinButton *)ui.bitrateSp); + config.bitrate = gtk_spin_button_get_value(ui.bitrateSp); } void on_startBtn_clicked() diff --git a/src/mandelbrot-zoom.h b/src/mandelbrot-zoom.h index 9f1b454..5032087 100644 --- a/src/mandelbrot-zoom.h +++ b/src/mandelbrot-zoom.h @@ -14,6 +14,7 @@ #include "conversion.h" typedef struct config { + u32 iterations; bool video; u8 filetype; u16 width; @@ -26,23 +27,31 @@ typedef struct config { } Config; typedef struct ui_settings { - GtkWidget *settings; - GtkWidget *exportCb; - GtkWidget *gifRd; - GtkWidget *widthSp; - GtkWidget *heightSp; - GtkWidget *fpsRenderSp; - GtkWidget *fpsVideoSp; - GtkWidget *bitrateSp; - GtkWidget *exportTf; - GtkWidget *startBtn; - GtkWidget *exitBtn; + GtkWindow *settings; + GtkSpinButton *iterationsSp; + GtkButton *colorFromBtn; + GtkButton *colorToBtn; + GtkCheckButton *exportCb; + GtkRadioButton *gifRd; + GtkSpinButton *widthSp; + GtkSpinButton *heightSp; + GtkSpinButton *fpsRenderSp; + GtkSpinButton *fpsVideoSp; + GtkSpinButton *bitrateSp; + GtkEntry *exportTf; + GtkButton *startBtn; + GtkButton *exitBtn; + GtkColorSelectionDialog *colorDialog; } ui_settings; ui_settings ui; Config config; +u8 currentColor; int main(int argc, char **argv); +void on_iterationsSp_valueChanged(); +void on_colorFromBtn_clicked(); +void on_colorToBtn_clicked(); void on_exportCb_toggled(); void on_exportTf_changed(); void on_widthSp_valueChanged(); diff --git a/src/settings.h b/src/settings.h index e8c99f4..89f40b8 100644 --- a/src/settings.h +++ b/src/settings.h @@ -8,6 +8,11 @@ #ifndef SETTINGS_H_ #define SETTINGS_H_ -#define FILETYPE_GIF 1; +// FILETYPES +#define FILETYPE_GIF 0; + +// COLOR SELECTORS +#define COLOR_FROM 0; +#define COLOR_TO 1; #endif /* SETTINGS_H_ */ |