89 lines
		
	
	
		
			2.6 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
		
		
			
		
	
	
			89 lines
		
	
	
		
			2.6 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
| 
								 | 
							
								/* PIKA - Photo and Image Kooker Application
							 | 
						||
| 
								 | 
							
								 * a rebranding of The GNU Image Manipulation Program (created with heckimp)
							 | 
						||
| 
								 | 
							
								 * A derived work which may be trivial. However, any changes may be (C)2023 by Aldercone Studio
							 | 
						||
| 
								 | 
							
								 *
							 | 
						||
| 
								 | 
							
								 * Original copyright, applying to most contents (license remains unchanged): 
							 | 
						||
| 
								 | 
							
								 * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
							 | 
						||
| 
								 | 
							
								 *
							 | 
						||
| 
								 | 
							
								 * pikaapp.c
							 | 
						||
| 
								 | 
							
								 * Copyright (C) 2021 Niels De Graef <nielsdegraef@gmail.com>
							 | 
						||
| 
								 | 
							
								 *
							 | 
						||
| 
								 | 
							
								 * 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
							 | 
						||
| 
								 | 
							
								 * Library General Public License for more details.
							 | 
						||
| 
								 | 
							
								 *
							 | 
						||
| 
								 | 
							
								 * You should have received a copy of the GNU Lesser General Public
							 | 
						||
| 
								 | 
							
								 * License along with this library.  If not, see
							 | 
						||
| 
								 | 
							
								 * <https://www.gnu.org/licenses/>.
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#include <config.h>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#include <gio/gio.h>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#include "libpikabase/pikabase.h"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#include "core/core-types.h"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#include "core/pika.h"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#include "pikaconsoleapp.h"
							 | 
						||
| 
								 | 
							
								#include "pikacoreapp.h"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								struct _PikaConsoleApp
							 | 
						||
| 
								 | 
							
								{
							 | 
						||
| 
								 | 
							
								  GApplication parent_instance;
							 | 
						||
| 
								 | 
							
								};
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								G_DEFINE_TYPE_WITH_CODE (PikaConsoleApp, pika_console_app, G_TYPE_APPLICATION,
							 | 
						||
| 
								 | 
							
								                         G_IMPLEMENT_INTERFACE (PIKA_TYPE_CORE_APP, NULL))
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								static void
							 | 
						||
| 
								 | 
							
								pika_console_app_class_init (PikaConsoleAppClass *klass)
							 | 
						||
| 
								 | 
							
								{
							 | 
						||
| 
								 | 
							
								  GObjectClass *gobj_class = G_OBJECT_CLASS (klass);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  gobj_class->get_property = pika_core_app_get_property;
							 | 
						||
| 
								 | 
							
								  gobj_class->set_property = pika_core_app_set_property;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  pika_core_app_install_properties (gobj_class);
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								static void
							 | 
						||
| 
								 | 
							
								pika_console_app_init (PikaConsoleApp *self)
							 | 
						||
| 
								 | 
							
								{
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/*  public functions  */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								GApplication *
							 | 
						||
| 
								 | 
							
								pika_console_app_new (Pika        *pika,
							 | 
						||
| 
								 | 
							
								                      gboolean     quit,
							 | 
						||
| 
								 | 
							
								                      gboolean     as_new,
							 | 
						||
| 
								 | 
							
								                      const char **filenames,
							 | 
						||
| 
								 | 
							
								                      const char  *batch_interpreter,
							 | 
						||
| 
								 | 
							
								                      const char **batch_commands)
							 | 
						||
| 
								 | 
							
								{
							 | 
						||
| 
								 | 
							
								  PikaConsoleApp *app;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  app = g_object_new (PIKA_TYPE_CONSOLE_APP,
							 | 
						||
| 
								 | 
							
								                      "application-id",    PIKA_APPLICATION_ID,
							 | 
						||
| 
								 | 
							
								#if GLIB_CHECK_VERSION(2,74,0)
							 | 
						||
| 
								 | 
							
								                      "flags",             G_APPLICATION_DEFAULT_FLAGS | G_APPLICATION_NON_UNIQUE,
							 | 
						||
| 
								 | 
							
								#else
							 | 
						||
| 
								 | 
							
								                      "flags",             G_APPLICATION_FLAGS_NONE | G_APPLICATION_NON_UNIQUE,
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								                      "pika",              pika,
							 | 
						||
| 
								 | 
							
								                      "filenames",         filenames,
							 | 
						||
| 
								 | 
							
								                      "as-new",            as_new,
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								                      "quit",              quit,
							 | 
						||
| 
								 | 
							
								                      "batch-interpreter", batch_interpreter,
							 | 
						||
| 
								 | 
							
								                      "batch-commands",    batch_commands,
							 | 
						||
| 
								 | 
							
								                      NULL);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  return G_APPLICATION (app);
							 | 
						||
| 
								 | 
							
								}
							 |