Commit 9b684364 authored by David Llewellyn-Jones's avatar David Llewellyn-Jones

Added an About dialogue (about time).

parent 0007896e
The MIT License
Copyright (c) 2012-2014 David Llewellyn-Jones
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
gladedir = $(datadir)/@PACKAGE@
glade_DATA = functy.ui
glade_DATA = functy.ui COPYING
EXTRA_DIST = $(glade_DATA)
SUBDIRS = icons shaders
......@@ -144,26 +144,24 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkImageMenuItem" id="MenuOpen">
<property name="label">gtk-open</property>
<object class="GtkMenuItem" id="MenuOpen">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Open an existing Functy XML file.
</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">Open...</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem" id="MenuSaveAs">
<property name="label">gtk-save-as</property>
<object class="GtkMenuItem" id="MenuSaveAs">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Save out your scene as a Functy XML file.</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">Save as...</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
</child>
<child>
......@@ -184,7 +182,7 @@
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Export as a triangulated model in Stanford Triangle Format (PLY).</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">PLY</property>
<property name="label" translatable="yes">Stanford Triangle Format (PLY)...</property>
<property name="use_underline">True</property>
</object>
</child>
......@@ -194,7 +192,7 @@
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Export as a triangulated model in Standard Tessellation Language (STL).</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">STL</property>
<property name="label" translatable="yes">Standard Tessellation Language (STL)...</property>
<property name="use_underline">True</property>
</object>
</child>
......@@ -204,7 +202,7 @@
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Export as a voxel volume in Shapeways SVX format.</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">SVX</property>
<property name="label" translatable="yes">Shapeways Voxel (SVX)...</property>
<property name="use_underline">True</property>
</object>
</child>
......@@ -214,7 +212,7 @@
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Export a bitmap image of the scene in PNG format.</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">PNG</property>
<property name="label" translatable="yes">Bitmap (PNG)...</property>
<property name="use_underline">True</property>
</object>
</child>
......@@ -241,7 +239,7 @@
<property name="tooltip_text" translatable="yes">Export each frame of the animation in Stanford Triangle Format (PLY).
The set of frames is compressed as a zip archive.</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">PLY</property>
<property name="label" translatable="yes">Stanford Triangle Format (PLY)...</property>
<property name="use_underline">True</property>
</object>
</child>
......@@ -252,7 +250,7 @@ The set of frames is compressed as a zip archive.</property>
<property name="tooltip_text" translatable="yes">Export each frame of the animation in Standard Tessellation Language (STL).
The set of frames is compressed as a zip archive.</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">STL</property>
<property name="label" translatable="yes">Standard Tessellation Language (STL)...</property>
<property name="use_underline">True</property>
</object>
</child>
......@@ -263,7 +261,7 @@ The set of frames is compressed as a zip archive.</property>
<property name="tooltip_text" translatable="yes">Export each frame of the animation as a PNG image.
The set of frames is compressed as a zip archive.</property>
<property name="use_action_appearance">False</property>
<property name="label" translatable="yes">PNG</property>
<property name="label" translatable="yes">Bitmap (PNG)...</property>
<property name="use_underline">True</property>
</object>
</child>
......
......@@ -191,6 +191,7 @@ static void SetButtonBarStyleIconsText (GtkWidget * psWidget, gpointer psData);
void SynchroniseButtonBarStyle (FunctyPersist * psFunctyData);
void SynchronisePanels (FunctyPersist * psFunctyData);
static gboolean BitmapWindowSizeToggle (GtkWidget * psWidget, gpointer psData);
static gboolean AboutShow (GtkWidget * psWidget, gpointer psData);
///////////////////////////////////////////////////////////////////
// Function definitions
......@@ -238,6 +239,7 @@ FunctyPersist * NewFunctyPersist (void) {
psFunctyData->boBitmapScreenDimensions = TRUE;
psFunctyData->nBitmapWidth = 512;
psFunctyData->nBitmapHeight = 512;
psFunctyData->szLicence = NULL;
return psFunctyData;
}
......@@ -273,6 +275,10 @@ void DeleteFunctyPersist (FunctyPersist * psFunctyData) {
if (psFunctyData->szExportBitmapName) {
g_string_free (psFunctyData->szExportBitmapName, TRUE);
}
if (psFunctyData->szLicence) {
g_free (psFunctyData->szLicence);
psFunctyData->szLicence = NULL;
}
g_free (psFunctyData);
}
......@@ -3948,6 +3954,36 @@ void PauseAnimationModal (bool boPauseModal, FunctyPersist * psFunctyData) {
}
}
void LoadLicence (FunctyPersist * psFunctyData) {
GFile * psLicence;
psLicence = g_file_new_for_path (FUNCTYDIR "/COPYING");
g_file_load_contents (psLicence, NULL, & psFunctyData->szLicence, NULL, NULL, NULL);
g_object_unref (psLicence);
}
static gboolean AboutShow (GtkWidget * psWidget, gpointer psData) {
FunctyPersist * psFunctyData = (FunctyPersist * )psData;
GtkWidget * psWindow;
GdkPixbuf * psIcon;
psWindow = GTK_WIDGET (gtk_builder_get_object (psFunctyData->psXML, "MainWindow"));
psIcon = gtk_window_get_icon (GTK_WINDOW (psWindow));
gtk_show_about_dialog (GTK_WINDOW (psWindow),
"program-name", "Functy",
"comments", "3D graph drawing package. Render Cartesian, spherical and parametric curve functions on the GPU.",
"copyright", "Copyright © 2014 David Llewellyn-Jones",
"logo", psIcon,
"title", "About Functy",
"wrap-license", TRUE,
"license", psFunctyData->szLicence,
"website", "http://functy.sourceforge.net/",
"version", VERSION,
NULL);
return TRUE;
}
int main (int argc, char *argv[]) {
GdkGLConfig * GlConfig;
......@@ -3986,6 +4022,9 @@ int main (int argc, char *argv[]) {
}
}
// Load the licence file
LoadLicence (psFunctyData);
// Load the user interface
psFunctyData->psXML = gtk_builder_new ();
gtk_builder_add_from_file (psFunctyData->psXML, FUNCTYDIR "/functy.ui", NULL);
......@@ -4131,7 +4170,8 @@ int main (int argc, char *argv[]) {
g_signal_connect (psWidget, "toggled", G_CALLBACK (SetButtonBarStyleIcons), (gpointer)psFunctyData);
psWidget = GTK_WIDGET (gtk_builder_get_object(psFunctyData->psXML, "MenuButtonBarIconsText"));
g_signal_connect (psWidget, "toggled", G_CALLBACK (SetButtonBarStyleIconsText), (gpointer)psFunctyData);
psWidget = GTK_WIDGET (gtk_builder_get_object(psFunctyData->psXML, "MenuAbout"));
g_signal_connect (psWidget, "activate", G_CALLBACK (AboutShow), (gpointer)psFunctyData);
/****************************************************************
* Removed during move from multiple dialogues to single window
......
......@@ -80,6 +80,7 @@ struct _FunctyPersist {
bool boBitmapScreenDimensions;
int nBitmapWidth;
int nBitmapHeight;
char * szLicence;
};
///////////////////////////////////////////////////////////////////
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment