Commit 2086cf17 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

app/actions/view-actions.c added actions and callbacks for scrolling the

2004-07-07  Michael Natterer  <mitch@gimp.org>

	* app/actions/view-actions.c
	* app/actions/view-commands.[ch]: added actions and callbacks for
	scrolling the view. Not used in menus but useful for controllers.
parent 9f25f860
2004-07-07 Michael Natterer <mitch@gimp.org>
* app/actions/view-actions.c
* app/actions/view-commands.[ch]: added actions and callbacks for
scrolling the view. Not used in menus but useful for controllers.
2004-07-07 Sven Neumann <sven@gimp.org>
* app/tools/gimpeditselectiontool.c
......
......@@ -275,6 +275,70 @@ static GimpEnumActionEntry view_padding_color_actions[] =
GIMP_HELP_VIEW_PADDING_COLOR }
};
static GimpEnumActionEntry view_scroll_horizontal_actions[] =
{
{ "view-scroll-horizontal", NULL,
"Set horizontal scroll offset", NULL, NULL,
GIMP_ACTION_SELECT_SET,
NULL },
{ "view-scroll-left-border", NULL,
"Scroll to left border", NULL, NULL,
GIMP_ACTION_SELECT_FIRST,
NULL },
{ "view-scroll-right-border", NULL,
"Scroll to right border", NULL, NULL,
GIMP_ACTION_SELECT_LAST,
NULL },
{ "view-scroll-left", NULL,
"Scroll left", NULL, NULL,
GIMP_ACTION_SELECT_PREVIOUS,
NULL },
{ "view-scroll-right", NULL,
"Scroll right", NULL, NULL,
GIMP_ACTION_SELECT_NEXT,
NULL },
{ "view-scroll-page-left", NULL,
"Scroll page left", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_PREVIOUS,
NULL },
{ "view-scroll-page-right", NULL,
"Scroll page right", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_NEXT,
NULL }
};
static GimpEnumActionEntry view_scroll_vertical_actions[] =
{
{ "view-scroll-vertical", NULL,
"Set vertical scroll offset", NULL, NULL,
GIMP_ACTION_SELECT_SET,
NULL },
{ "view-scroll-top-border", NULL,
"Scroll to top border", NULL, NULL,
GIMP_ACTION_SELECT_FIRST,
NULL },
{ "view-scroll-bottom-border", NULL,
"Scroll to bottom border", NULL, NULL,
GIMP_ACTION_SELECT_LAST,
NULL },
{ "view-scroll-up", NULL,
"Scroll up", NULL, NULL,
GIMP_ACTION_SELECT_PREVIOUS,
NULL },
{ "view-scroll-down", NULL,
"Scroll down", NULL, NULL,
GIMP_ACTION_SELECT_NEXT,
NULL },
{ "view-scroll-page-up", NULL,
"Scroll page up", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_PREVIOUS,
NULL },
{ "view-scroll-page-down", NULL,
"Scroll page down", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_NEXT,
NULL }
};
void
view_actions_setup (GimpActionGroup *group)
......@@ -300,6 +364,16 @@ view_actions_setup (GimpActionGroup *group)
G_N_ELEMENTS (view_padding_color_actions),
G_CALLBACK (view_padding_color_cmd_callback));
gimp_action_group_add_enum_actions (group,
view_scroll_horizontal_actions,
G_N_ELEMENTS (view_scroll_horizontal_actions),
G_CALLBACK (view_scroll_horizontal_cmd_callback));
gimp_action_group_add_enum_actions (group,
view_scroll_vertical_actions,
G_N_ELEMENTS (view_scroll_vertical_actions),
G_CALLBACK (view_scroll_vertical_cmd_callback));
/* connect "activate" of view-zoom-other manually so it can be
* selected even if it's the active item of the radio group
*/
......
......@@ -200,6 +200,52 @@ view_dot_for_dot_cmd_callback (GtkAction *action,
}
}
void
view_scroll_horizontal_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpDisplay *gdisp;
GimpDisplayShell *shell;
gdouble offset;
return_if_no_display (gdisp, data);
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
offset = action_select_value ((GimpActionSelectType) value,
shell->hsbdata->value,
shell->hsbdata->lower,
shell->hsbdata->upper -
shell->hsbdata->page_size,
shell->hsbdata->step_increment,
shell->hsbdata->page_increment,
FALSE);
gtk_adjustment_set_value (shell->hsbdata, offset);
}
void
view_scroll_vertical_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpDisplay *gdisp;
GimpDisplayShell *shell;
gdouble offset;
return_if_no_display (gdisp, data);
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
offset = action_select_value ((GimpActionSelectType) value,
shell->vsbdata->value,
shell->vsbdata->lower,
shell->vsbdata->upper -
shell->vsbdata->page_size,
shell->vsbdata->step_increment,
shell->vsbdata->page_increment,
FALSE);
gtk_adjustment_set_value (shell->vsbdata, offset);
}
void
view_info_window_cmd_callback (GtkAction *action,
gpointer data)
......
......@@ -40,6 +40,14 @@ void view_zoom_other_cmd_callback (GtkAction *action,
gpointer data);
void view_dot_for_dot_cmd_callback (GtkAction *action,
gpointer data);
void view_scroll_horizontal_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void view_scroll_vertical_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void view_info_window_cmd_callback (GtkAction *action,
gpointer data);
void view_navigation_window_cmd_callback (GtkAction *action,
......
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