Author: akv
Date: 2010-12-30 03:49:26 +0100 (Thu, 30 Dec 2010)
New Revision: 3742
Added:
trunk/librawstudio/rs-gui-functions.c
trunk/librawstudio/rs-gui-functions.h
Modified:
trunk/librawstudio/Makefile.am
trunk/src/gtk-helper.c
trunk/src/gtk-helper.h
trunk/src/gtk-interface.c
trunk/src/rs-actions.c
Log:
Moved gui_dialog_* functions to new rs-gui-functions.c in librawstudio.
Modified: trunk/librawstudio/Makefile.am
===================================================================
--- trunk/librawstudio/Makefile.am 2010-12-30 02:41:05 UTC (rev 3741)
+++ trunk/librawstudio/Makefile.am 2010-12-30 02:49:26 UTC (rev 3742)
@@ -56,6 +56,7 @@
rs-profile-factory.h \
rs-profile-selector.h \
rs-profile-camera.h \
+ rs-gui-functions.h \
x86-cpu.h
lib_LTLIBRARIES = librawstudio-1.1.la
@@ -104,6 +105,7 @@
rs-profile-camera.c rs-profile-camera.h \
rs-color-space-selector.c rs-color-space-selector.h \
conf_interface.c conf_interface.h \
+ rs-gui-functions.c rs-gui-functions.h \
rs-stock.c rs-stock.h
librawstudio_1_1_la_LIBADD = @PACKAGE_LIBS@ @LIBJPEG@ @LIBTIFF@ $(INTLLIBS)
Added: trunk/librawstudio/rs-gui-functions.c
===================================================================
--- trunk/librawstudio/rs-gui-functions.c (rev 0)
+++ trunk/librawstudio/rs-gui-functions.c 2010-12-30 02:49:26 UTC (rev
3742)
@@ -0,0 +1,77 @@
+/*
+ * * Copyright (C) 2006-2010 Anders Brander <[email protected]>,
+ * * Anders Kvist <[email protected]> and Klaus Post <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA.
+ */
+
+#include <glib.h>
+#include <glib/gstdio.h>
+#include <gtk/gtk.h>
+#include "rs-gui-functions.h"
+
+GtkWidget *
+gui_dialog_make_from_text(const gchar *stock_id, gchar *primary_text, gchar
*secondary_text)
+{
+ GtkWidget *secondary_label;
+
+ secondary_label = gtk_label_new (NULL);
+ gtk_label_set_line_wrap (GTK_LABEL (secondary_label), TRUE);
+ gtk_label_set_use_markup (GTK_LABEL (secondary_label), TRUE);
+ gtk_misc_set_alignment (GTK_MISC (secondary_label), 0.0, 0.5);
+ gtk_label_set_selectable (GTK_LABEL (secondary_label), TRUE);
+ gtk_label_set_markup (GTK_LABEL (secondary_label), secondary_text);
+
+ return(gui_dialog_make_from_widget(stock_id, primary_text,
secondary_label));
+}
+
+GtkWidget *
+gui_dialog_make_from_widget(const gchar *stock_id, gchar *primary_text,
GtkWidget *widget)
+{
+ GtkWidget *dialog, *image, *hhbox, *vvbox;
+ GtkWidget *primary_label;
+ gchar *str;
+
+ image = gtk_image_new_from_stock(stock_id, GTK_ICON_SIZE_DIALOG);
+ gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.0);
+ dialog = gtk_dialog_new();
+ gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
+ gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 14);
+ gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
+ gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
+ gtk_window_set_title (GTK_WINDOW (dialog), "");
+ gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
+ gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE);
+
+ primary_label = gtk_label_new (NULL);
+ gtk_label_set_line_wrap (GTK_LABEL (primary_label), TRUE);
+ gtk_label_set_use_markup (GTK_LABEL (primary_label), TRUE);
+ gtk_misc_set_alignment (GTK_MISC (primary_label), 0.0, 0.5);
+ gtk_label_set_selectable (GTK_LABEL (primary_label), TRUE);
+ str = g_strconcat("<span weight=\"bold\" size=\"larger\">",
primary_text, "</span>", NULL);
+ gtk_label_set_markup (GTK_LABEL (primary_label), str);
+ g_free(str);
+
+ hhbox = gtk_hbox_new (FALSE, 12);
+ gtk_container_set_border_width (GTK_CONTAINER (hhbox), 5);
+ gtk_box_pack_start (GTK_BOX (hhbox), image, FALSE, FALSE, 0);
+ vvbox = gtk_vbox_new (FALSE, 12);
+ gtk_box_pack_start (GTK_BOX (hhbox), vvbox, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (vvbox), primary_label, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (vvbox), widget, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hhbox, FALSE,
FALSE, 0);
+
+ return(dialog);
+}
Added: trunk/librawstudio/rs-gui-functions.h
===================================================================
--- trunk/librawstudio/rs-gui-functions.h (rev 0)
+++ trunk/librawstudio/rs-gui-functions.h 2010-12-30 02:49:26 UTC (rev
3742)
@@ -0,0 +1,30 @@
+/*
+ * * Copyright (C) 2006-2010 Anders Brander <[email protected]>,
+ * * Anders Kvist <[email protected]> and Klaus Post <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA.
+ */
+
+#ifndef GUI_FUNCTIONS_H
+#define GUI_FUNCTIONS_H
+
+#include <glib.h>
+#include <glib/gstdio.h>
+#include <gtk/gtk.h>
+
+extern GtkWidget *gui_dialog_make_from_text(const gchar *stock_id, gchar
*primary_text, gchar *secondary_text);
+extern GtkWidget *gui_dialog_make_from_widget(const gchar *stock_id, gchar
*primary_text, GtkWidget *widget);
+
+#endif /* GUI_FUNCTIONS_H */
Modified: trunk/src/gtk-helper.c
===================================================================
--- trunk/src/gtk-helper.c 2010-12-30 02:41:05 UTC (rev 3741)
+++ trunk/src/gtk-helper.c 2010-12-30 02:49:26 UTC (rev 3742)
@@ -30,6 +30,7 @@
#include "filename.h"
#include "gtk-helper.h"
#include "rs-preview-widget.h"
+#include "rs-gui-functions.h"
#include <gettext.h>
#include <lcms.h>
@@ -545,60 +546,6 @@
return pixbuf;
}
-GtkWidget *
-gui_dialog_make_from_text(const gchar *stock_id, gchar *primary_text, gchar
*secondary_text)
-{
- GtkWidget *secondary_label;
-
- secondary_label = gtk_label_new (NULL);
- gtk_label_set_line_wrap (GTK_LABEL (secondary_label), TRUE);
- gtk_label_set_use_markup (GTK_LABEL (secondary_label), TRUE);
- gtk_misc_set_alignment (GTK_MISC (secondary_label), 0.0, 0.5);
- gtk_label_set_selectable (GTK_LABEL (secondary_label), TRUE);
- gtk_label_set_markup (GTK_LABEL (secondary_label), secondary_text);
-
- return(gui_dialog_make_from_widget(stock_id, primary_text,
secondary_label));
-}
-
-GtkWidget *
-gui_dialog_make_from_widget(const gchar *stock_id, gchar *primary_text,
GtkWidget *widget)
-{
- GtkWidget *dialog, *image, *hhbox, *vvbox;
- GtkWidget *primary_label;
- gchar *str;
-
- image = gtk_image_new_from_stock(stock_id, GTK_ICON_SIZE_DIALOG);
- gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.0);
- dialog = gtk_dialog_new();
- gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 14);
- gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
- gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
- gtk_window_set_title (GTK_WINDOW (dialog), "");
- gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
- gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE);
-
- primary_label = gtk_label_new (NULL);
- gtk_label_set_line_wrap (GTK_LABEL (primary_label), TRUE);
- gtk_label_set_use_markup (GTK_LABEL (primary_label), TRUE);
- gtk_misc_set_alignment (GTK_MISC (primary_label), 0.0, 0.5);
- gtk_label_set_selectable (GTK_LABEL (primary_label), TRUE);
- str = g_strconcat("<span weight=\"bold\" size=\"larger\">",
primary_text, "</span>", NULL);
- gtk_label_set_markup (GTK_LABEL (primary_label), str);
- g_free(str);
-
- hhbox = gtk_hbox_new (FALSE, 12);
- gtk_container_set_border_width (GTK_CONTAINER (hhbox), 5);
- gtk_box_pack_start (GTK_BOX (hhbox), image, FALSE, FALSE, 0);
- vvbox = gtk_vbox_new (FALSE, 12);
- gtk_box_pack_start (GTK_BOX (hhbox), vvbox, FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (vvbox), primary_label, FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (vvbox), widget, FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hhbox, FALSE,
FALSE, 0);
-
- return(dialog);
-}
-
/**
* Creates a new GtkButton widget.
* @param stock_id A stock id registered with GTK+
Modified: trunk/src/gtk-helper.h
===================================================================
--- trunk/src/gtk-helper.h 2010-12-30 02:41:05 UTC (rev 3741)
+++ trunk/src/gtk-helper.h 2010-12-30 02:49:26 UTC (rev 3742)
@@ -66,9 +66,6 @@
extern void gui_select_theme(RS_THEME theme);
-extern GtkWidget *gui_dialog_make_from_text(const gchar *stock_id, gchar
*primary_text, gchar *secondary_text);
-extern GtkWidget *gui_dialog_make_from_widget(const gchar *stock_id, gchar
*primary_text, GtkWidget *widget);
-
/**
* Creates a new GtkButton widget.
* @param stock_id A stock id registered with GTK+
Modified: trunk/src/gtk-interface.c
===================================================================
--- trunk/src/gtk-interface.c 2010-12-30 02:41:05 UTC (rev 3741)
+++ trunk/src/gtk-interface.c 2010-12-30 02:49:26 UTC (rev 3742)
@@ -43,6 +43,7 @@
#include "rs-toolbox.h"
#include "rs-library.h"
#include "rs-tag-gui.h"
+#include "rs-gui-functions.h"
static GtkStatusbar *statusbar;
static gboolean fullscreen;
Modified: trunk/src/rs-actions.c
===================================================================
--- trunk/src/rs-actions.c 2010-12-30 02:41:05 UTC (rev 3741)
+++ trunk/src/rs-actions.c 2010-12-30 02:49:26 UTC (rev 3742)
@@ -42,6 +42,7 @@
#include "rs-camera-db.h"
#include "rs-toolbox.h"
#include "rs-tethered-shooting.h"
+#include "rs-gui-functions.h"
static GtkActionGroup *core_action_group = NULL;
static GStaticMutex rs_actions_spinlock = G_STATIC_MUTEX_INIT;
_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit