本文整理汇总了C++中GTH_BROWSER函数的典型用法代码示例。如果您正苦于以下问题:C++ GTH_BROWSER函数的具体用法?C++ GTH_BROWSER怎么用?C++ GTH_BROWSER使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GTH_BROWSER函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: gth_file_tool_negative_activate
static void
gth_file_tool_negative_activate (GthFileTool *base)
{
GtkWidget *window;
GtkWidget *viewer_page;
GthTask *task;
window = gth_file_tool_get_window (base);
viewer_page = gth_browser_get_viewer_page (GTH_BROWSER (window));
if (! GTH_IS_IMAGE_VIEWER_PAGE (viewer_page))
return;
task = gth_image_viewer_task_new (GTH_IMAGE_VIEWER_PAGE (viewer_page),
_("Applying changes"),
NULL,
negative_exec,
NULL,
NULL,
NULL);
g_signal_connect (task,
"completed",
G_CALLBACK (gth_image_viewer_task_set_destination),
NULL);
gth_browser_exec_task (GTH_BROWSER (window), task, FALSE);
}
示例2: ok_button_clicked_cb
static void
ok_button_clicked_cb (GtkButton *button,
GthFileToolSharpen *self)
{
GtkWidget *window;
GtkWidget *viewer_page;
SharpenData *sharpen_data;
GthTask *task;
if (self->priv->apply_event != 0) {
g_source_remove (self->priv->apply_event);
self->priv->apply_event = 0;
}
window = gth_file_tool_get_window (GTH_FILE_TOOL (self));
viewer_page = gth_browser_get_viewer_page (GTH_BROWSER (window));
if (! GTH_IS_IMAGE_VIEWER_PAGE (viewer_page))
return;
sharpen_data = sharpen_data_new (self);
sharpen_data->viewer_page = g_object_ref (viewer_page);
sharpen_data->source = cairo_surface_reference (self->priv->source);
task = gth_async_task_new (sharpen_before,
sharpen_exec,
sharpen_after,
sharpen_data,
sharpen_data_free);
gth_browser_exec_task (GTH_BROWSER (gth_file_tool_get_window (GTH_FILE_TOOL (self))), task, FALSE);
g_object_unref (task);
gth_file_tool_hide_options (GTH_FILE_TOOL (self));
}
示例3: gth_file_tool_equalize_activate
static void
gth_file_tool_equalize_activate (GthFileTool *base)
{
GtkWidget *window;
GtkWidget *viewer_page;
EqualizeData *equalize_data;
GthTask *task;
window = gth_file_tool_get_window (base);
viewer_page = gth_browser_get_viewer_page (GTH_BROWSER (window));
if (! GTH_IS_IMAGE_VIEWER_PAGE (viewer_page))
return;
equalize_data = g_new0 (EqualizeData, 1);
task = gth_image_viewer_task_new (GTH_IMAGE_VIEWER_PAGE (viewer_page),
_("Equalizing image histogram"),
NULL,
equalize_exec,
NULL,
equalize_data,
equalize_destroy_data);
g_signal_connect (task,
"completed",
G_CALLBACK (gth_image_viewer_task_set_destination),
NULL);
gth_browser_exec_task (GTH_BROWSER (window), task, FALSE);
}
示例4: gth_file_tool_negative_activate
static void
gth_file_tool_negative_activate (GthFileTool *base)
{
GtkWidget *window;
GtkWidget *viewer_page;
GtkWidget *viewer;
cairo_surface_t *image;
NegativeData *negative_data;
GthTask *task;
window = gth_file_tool_get_window (base);
viewer_page = gth_browser_get_viewer_page (GTH_BROWSER (window));
if (! GTH_IS_IMAGE_VIEWER_PAGE (viewer_page))
return;
viewer = gth_image_viewer_page_get_image_viewer (GTH_IMAGE_VIEWER_PAGE (viewer_page));
image = gth_image_viewer_get_current_image (GTH_IMAGE_VIEWER (viewer));
if (image == NULL)
return;
negative_data = g_new0 (NegativeData, 1);
negative_data->viewer_page = viewer_page;
negative_data->source = cairo_surface_reference (image);
task = gth_async_task_new (negative_init,
negative_exec,
negative_after,
negative_data,
negative_data_free);
gth_browser_exec_task (GTH_BROWSER (window), task, FALSE);
g_object_unref (task);
}
示例5: gth_file_tool_save_as_update_sensitivity
static void
gth_file_tool_save_as_update_sensitivity (GthFileTool *base)
{
GtkWidget *window;
gboolean can_save;
window = gth_file_tool_get_window (base);
can_save = gth_viewer_page_can_save (GTH_VIEWER_PAGE (gth_browser_get_viewer_page (GTH_BROWSER (window))));
can_save = can_save && (gth_browser_get_current_file (GTH_BROWSER (window)) != NULL);
gtk_widget_set_sensitive (GTK_WIDGET (base), can_save);
}
示例6: gth_browser_activate_browser_properties
void
gth_browser_activate_browser_properties (GSimpleAction *action,
GVariant *state,
gpointer user_data)
{
GthBrowser *browser = user_data;
g_simple_action_set_state (action, state);
if (g_variant_get_boolean (state))
gth_browser_show_file_properties (GTH_BROWSER (browser));
else
gth_browser_hide_sidebar (GTH_BROWSER (browser));
}
示例7: gth_browser_activate_folder_context_move_to
void
gth_browser_activate_folder_context_move_to (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
copy_folder_to_folder (GTH_BROWSER (user_data), TRUE);
}
示例8: gth_browser_activate_folder_context_open_in_file_manager
void
gth_browser_activate_folder_context_open_in_file_manager (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
GthBrowser *browser = GTH_BROWSER (user_data);
GthFileData *file_data;
char *uri;
GError *error = NULL;
file_data = gth_browser_get_folder_popup_file_data (browser);
if (file_data == NULL)
return;
uri = g_file_get_uri (file_data->file);
if (! gtk_show_uri_on_window (GTK_WINDOW (browser),
uri,
GDK_CURRENT_TIME,
&error))
{
_gtk_error_dialog_from_gerror_run (GTK_WINDOW (browser), _("Could not open the location"), error);
g_clear_error (&error);
}
g_free (uri);
g_object_unref (file_data);
}
示例9: gth_browser_activate_move_to_folder
void
gth_browser_activate_move_to_folder (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
copy_selected_files_to_folder (GTH_BROWSER (user_data), TRUE);
}
示例10: gth_browser_activate_browser_edit_file
void
gth_browser_activate_browser_edit_file (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
gth_browser_show_viewer_tools (GTH_BROWSER (user_data));
}
示例11: gth_browser_activate_go_to_history_pos
void
gth_browser_activate_go_to_history_pos (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
gth_browser_go_to_history_pos (GTH_BROWSER (user_data), atoi (g_variant_get_string (parameter, NULL)));
}
示例12: gth_browser_activate_import_folder
void
gth_browser_activate_import_folder (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
GthBrowser *browser = GTH_BROWSER (user_data);
GtkWidget *chooser;
GFile *folder;
chooser = gtk_file_chooser_dialog_new (_("Choose a folder"),
GTK_WINDOW (browser),
GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
_GTK_LABEL_CANCEL, GTK_RESPONSE_CANCEL,
_("Import"), GTK_RESPONSE_OK,
NULL);
_gtk_dialog_add_class_to_response (GTK_DIALOG (chooser), GTK_RESPONSE_OK, GTK_STYLE_CLASS_SUGGESTED_ACTION);
gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (chooser), FALSE);
folder = NULL;
if (GTH_IS_FILE_SOURCE_VFS (gth_browser_get_location_source (browser)))
folder = _g_object_ref (gth_browser_get_location (browser));
if (folder == NULL)
folder = g_file_new_for_uri (get_home_uri ());
gtk_file_chooser_set_file (GTK_FILE_CHOOSER (chooser), folder, NULL);
g_signal_connect (chooser,
"response",
G_CALLBACK (folder_chooser_response_cb),
browser);
gtk_widget_show (chooser);
_g_object_unref (folder);
}
示例13: impl_gth_application_load_image
static void
impl_gth_application_load_image (PortableServer_Servant _servant,
const CORBA_char *uri,
CORBA_Environment *ev)
{
if (*uri == '\0')
uri = NULL;
if (UseViewer) {
GtkWidget *viewer = gth_viewer_get_current_viewer ();
if (viewer == NULL) {
show_grabbing_focus (gth_viewer_new (uri));
}
else {
gth_viewer_load_from_uri (GTH_VIEWER (viewer), uri);
show_grabbing_focus (viewer);
}
}
else {
GtkWidget *browser = gth_browser_get_current_browser ();
if (browser == NULL) {
show_grabbing_focus (gth_browser_new (uri));
}
else {
gth_browser_load_uri (GTH_BROWSER (browser), uri);
show_grabbing_focus (browser);
}
}
}
示例14: update_image_size_cb
static gboolean
update_image_size_cb (gpointer user_data)
{
GthFileToolResize *self = user_data;
self->priv->update_size_id = 0;
if (self->priv->resize_task != NULL) {
gth_task_cancel (self->priv->resize_task);
return FALSE;
}
self->priv->resize_task = gth_image_task_new (_("Resizing images"),
NULL,
resize_task_exec,
NULL,
self,
NULL);
if (self->priv->apply_to_original)
gth_image_task_set_source_surface (GTH_IMAGE_TASK (self->priv->resize_task), gth_image_viewer_page_tool_get_source (GTH_IMAGE_VIEWER_PAGE_TOOL (self)));
else
gth_image_task_set_source_surface (GTH_IMAGE_TASK (self->priv->resize_task), self->priv->preview);
g_signal_connect (self->priv->resize_task,
"completed",
G_CALLBACK (resize_task_completed_cb),
self);
gth_browser_exec_task (GTH_BROWSER (gth_file_tool_get_window (GTH_FILE_TOOL (self))),
self->priv->resize_task,
GTH_TASK_FLAGS_DEFAULT);
return FALSE;
}
示例15: gth_browser_activate_sort_by
void
gth_browser_activate_sort_by (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
dlg_sort_order (GTH_BROWSER (user_data));
}