PIKApp/app/display/pikatoolrectangle.h

129 lines
5.5 KiB
C
Raw Normal View History

2023-09-26 00:35:21 +02:00
/* 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 Spencer Kimball and Peter Mattis
*
* pikatoolrectangle.h
* Copyright (C) 2017 Michael Natterer <mitch@gimp.org>
*
* Based on PikaRectangleTool
* Copyright (C) 2007 Martin Nordholts
*
* 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 3 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, see <https://www.gnu.org/licenses/>.
*/
#ifndef __PIKA_TOOL_RECTANGLE_H__
#define __PIKA_TOOL_RECTANGLE_H__
#include "pikatoolwidget.h"
typedef enum
{
PIKA_TOOL_RECTANGLE_DEAD,
PIKA_TOOL_RECTANGLE_CREATING,
PIKA_TOOL_RECTANGLE_MOVING,
PIKA_TOOL_RECTANGLE_RESIZING_UPPER_LEFT,
PIKA_TOOL_RECTANGLE_RESIZING_UPPER_RIGHT,
PIKA_TOOL_RECTANGLE_RESIZING_LOWER_LEFT,
PIKA_TOOL_RECTANGLE_RESIZING_LOWER_RIGHT,
PIKA_TOOL_RECTANGLE_RESIZING_LEFT,
PIKA_TOOL_RECTANGLE_RESIZING_RIGHT,
PIKA_TOOL_RECTANGLE_RESIZING_TOP,
PIKA_TOOL_RECTANGLE_RESIZING_BOTTOM,
PIKA_TOOL_RECTANGLE_AUTO_SHRINK,
PIKA_TOOL_RECTANGLE_EXECUTING,
PIKA_N_TOOL_RECTANGLE_FUNCTIONS
} PikaRectangleFunction;
#define PIKA_TYPE_TOOL_RECTANGLE (pika_tool_rectangle_get_type ())
#define PIKA_TOOL_RECTANGLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PIKA_TYPE_TOOL_RECTANGLE, PikaToolRectangle))
#define PIKA_TOOL_RECTANGLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PIKA_TYPE_TOOL_RECTANGLE, PikaToolRectangleClass))
#define PIKA_IS_TOOL_RECTANGLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PIKA_TYPE_TOOL_RECTANGLE))
#define PIKA_IS_TOOL_RECTANGLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PIKA_TYPE_TOOL_RECTANGLE))
#define PIKA_TOOL_RECTANGLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PIKA_TYPE_TOOL_RECTANGLE, PikaToolRectangleClass))
typedef struct _PikaToolRectangle PikaToolRectangle;
typedef struct _PikaToolRectanglePrivate PikaToolRectanglePrivate;
typedef struct _PikaToolRectangleClass PikaToolRectangleClass;
struct _PikaToolRectangle
{
PikaToolWidget parent_instance;
PikaToolRectanglePrivate *private;
};
struct _PikaToolRectangleClass
{
PikaToolWidgetClass parent_class;
/* signals */
gboolean (* change_complete) (PikaToolRectangle *rectangle);
};
GType pika_tool_rectangle_get_type (void) G_GNUC_CONST;
PikaToolWidget * pika_tool_rectangle_new (PikaDisplayShell *shell);
PikaRectangleFunction
pika_tool_rectangle_get_function (PikaToolRectangle *rectangle);
void pika_tool_rectangle_set_function (PikaToolRectangle *rectangle,
PikaRectangleFunction function);
void pika_tool_rectangle_set_constraint (PikaToolRectangle *rectangle,
PikaRectangleConstraint constraint);
PikaRectangleConstraint
pika_tool_rectangle_get_constraint (PikaToolRectangle *rectangle);
void pika_tool_rectangle_get_public_rect (PikaToolRectangle *rectangle,
gdouble *pub_x1,
gdouble *pub_y1,
gdouble *pub_x2,
gdouble *pub_y2);
void pika_tool_rectangle_pending_size_set (PikaToolRectangle *rectangle,
GObject *object,
const gchar *width_property,
const gchar *height_property);
void pika_tool_rectangle_constraint_size_set
(PikaToolRectangle *rectangle,
GObject *object,
const gchar *width_property,
const gchar *height_property);
gboolean pika_tool_rectangle_rectangle_is_first
(PikaToolRectangle *rectangle);
gboolean pika_tool_rectangle_rectangle_is_new (PikaToolRectangle *rectangle);
gboolean pika_tool_rectangle_point_in_rectangle
(PikaToolRectangle *rectangle,
gdouble x,
gdouble y);
void pika_tool_rectangle_frame_item (PikaToolRectangle *rectangle,
PikaItem *item);
void pika_tool_rectangle_auto_shrink (PikaToolRectangle *rectrectangle,
gboolean shrink_merged);
#endif /* __PIKA_TOOL_RECTANGLE_H__ */