2003-03-28 14:13:54 +00:00
|
|
|
/* LIBGIMP - The GIMP Library
|
2003-07-03 00:47:26 +00:00
|
|
|
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
|
2003-03-28 14:13:54 +00:00
|
|
|
*
|
|
|
|
* gimpfontselect_pdb.c
|
|
|
|
*
|
2009-01-17 22:28:01 +00:00
|
|
|
* This library is free software: you can redistribute it and/or
|
2003-03-28 14:13:54 +00:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
2009-01-17 22:28:01 +00:00
|
|
|
* version 3 of the License, or (at your option) any later version.
|
2003-03-28 14:13:54 +00:00
|
|
|
*
|
|
|
|
* This library 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
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2009-01-17 22:28:01 +00:00
|
|
|
* License along with this library. If not, see
|
2018-07-11 23:27:07 +02:00
|
|
|
* <https://www.gnu.org/licenses/>.
|
2003-03-28 14:13:54 +00:00
|
|
|
*/
|
|
|
|
|
2007-01-09 10:52:47 +00:00
|
|
|
/* NOTE: This file is auto-generated by pdbgen.pl */
|
2003-03-28 14:13:54 +00:00
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include "gimp.h"
|
|
|
|
|
2010-07-07 11:43:10 +02:00
|
|
|
|
|
|
|
/**
|
2019-07-31 10:04:43 +02:00
|
|
|
* SECTION: gimpfontselect
|
2010-07-07 11:43:10 +02:00
|
|
|
* @title: gimpfontselect
|
|
|
|
* @short_description: Functions providing a font selection dialog.
|
|
|
|
*
|
|
|
|
* Functions providing a font selection dialog.
|
|
|
|
**/
|
|
|
|
|
|
|
|
|
2003-03-28 14:13:54 +00:00
|
|
|
/**
|
|
|
|
* gimp_fonts_popup:
|
|
|
|
* @font_callback: The callback PDB proc to call when font selection is made.
|
2007-01-09 10:52:47 +00:00
|
|
|
* @popup_title: Title of the font selection dialog.
|
2003-03-28 14:13:54 +00:00
|
|
|
* @initial_font: The name of the font to set as the first selected.
|
|
|
|
*
|
|
|
|
* Invokes the Gimp font selection.
|
|
|
|
*
|
2007-01-09 10:52:47 +00:00
|
|
|
* This procedure opens the font selection dialog.
|
2003-03-28 14:13:54 +00:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2003-03-28 14:13:54 +00:00
|
|
|
gboolean
|
2003-07-02 01:20:08 +00:00
|
|
|
gimp_fonts_popup (const gchar *font_callback,
|
2006-04-12 10:27:31 +00:00
|
|
|
const gchar *popup_title,
|
|
|
|
const gchar *initial_font)
|
2003-03-28 14:13:54 +00:00
|
|
|
{
|
2019-08-06 21:34:00 +02:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2003-03-28 14:13:54 +00:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
args = gimp_value_array_new_from_types (G_TYPE_STRING,
|
|
|
|
G_TYPE_STRING,
|
|
|
|
G_TYPE_STRING,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
g_value_set_string (gimp_value_array_index (args, 0), font_callback);
|
|
|
|
g_value_set_string (gimp_value_array_index (args, 1), popup_title);
|
|
|
|
g_value_set_string (gimp_value_array_index (args, 2), initial_font);
|
2003-03-28 14:13:54 +00:00
|
|
|
|
2019-08-06 21:34:00 +02:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-fonts-popup",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-06 21:44:26 +02:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-fonts-popup",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2003-03-28 14:13:54 +00:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2003-03-28 14:13:54 +00:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_fonts_close_popup:
|
2007-01-09 10:52:47 +00:00
|
|
|
* @font_callback: The name of the callback registered for this pop-up.
|
2003-03-28 14:13:54 +00:00
|
|
|
*
|
2007-01-09 10:52:47 +00:00
|
|
|
* Close the font selection dialog.
|
2003-03-28 14:13:54 +00:00
|
|
|
*
|
|
|
|
* This procedure closes an opened font selection dialog.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2003-03-28 14:13:54 +00:00
|
|
|
gboolean
|
2003-07-02 01:20:08 +00:00
|
|
|
gimp_fonts_close_popup (const gchar *font_callback)
|
2003-03-28 14:13:54 +00:00
|
|
|
{
|
2019-08-06 21:34:00 +02:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2003-03-28 14:13:54 +00:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
args = gimp_value_array_new_from_types (G_TYPE_STRING,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
g_value_set_string (gimp_value_array_index (args, 0), font_callback);
|
|
|
|
|
2019-08-06 21:34:00 +02:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-fonts-close-popup",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-06 21:44:26 +02:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-fonts-close-popup",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2003-03-28 14:13:54 +00:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
|
2003-03-28 14:13:54 +00:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2003-03-28 14:13:54 +00:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_fonts_set_popup:
|
2007-01-09 10:52:47 +00:00
|
|
|
* @font_callback: The name of the callback registered for this pop-up.
|
2003-03-28 14:13:54 +00:00
|
|
|
* @font_name: The name of the font to set as selected.
|
|
|
|
*
|
2007-01-09 10:52:47 +00:00
|
|
|
* Sets the current font in a font selection dialog.
|
2003-03-28 14:13:54 +00:00
|
|
|
*
|
2007-01-09 10:52:47 +00:00
|
|
|
* Sets the current font in a font selection dialog.
|
2003-03-28 14:13:54 +00:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2003-03-28 14:13:54 +00:00
|
|
|
gboolean
|
2003-07-02 01:20:08 +00:00
|
|
|
gimp_fonts_set_popup (const gchar *font_callback,
|
2006-04-12 10:27:31 +00:00
|
|
|
const gchar *font_name)
|
2003-03-28 14:13:54 +00:00
|
|
|
{
|
2019-08-06 21:34:00 +02:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2003-03-28 14:13:54 +00:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
args = gimp_value_array_new_from_types (G_TYPE_STRING,
|
|
|
|
G_TYPE_STRING,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
g_value_set_string (gimp_value_array_index (args, 0), font_callback);
|
|
|
|
g_value_set_string (gimp_value_array_index (args, 1), font_name);
|
|
|
|
|
2019-08-06 21:34:00 +02:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-fonts-set-popup",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-06 21:44:26 +02:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-fonts-set-popup",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2003-03-28 14:13:54 +00:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
|
2003-03-28 14:13:54 +00:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2003-03-28 14:13:54 +00:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|