summaryrefslogtreecommitdiffstats
path: root/gtk/src
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/src')
-rw-r--r--gtk/src/callbacks.c29
-rw-r--r--gtk/src/ghbcellrenderertext.c109
-rw-r--r--gtk/src/ghbcompat.h32
-rw-r--r--gtk/src/ghbcompositor.c127
-rw-r--r--gtk/src/main.c69
-rw-r--r--gtk/src/preview.c70
-rw-r--r--gtk/src/queuehandler.c28
-rw-r--r--gtk/src/renderer_button.c4
8 files changed, 9 insertions, 459 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c
index fd1988ea9..38ed583d4 100644
--- a/gtk/src/callbacks.c
+++ b/gtk/src/callbacks.c
@@ -1278,7 +1278,6 @@ do_source_dialog(GtkButton *button, gboolean single, signal_user_data_t *ud)
dialog = GHB_WIDGET(ud->builder, "source_dialog");
source_dialog_extra_widgets(ud, dialog);
-#if GTK_CHECK_VERSION(3, 0, 0)
// gtk3 has a STUPID BUG! If you select the "same_path" it ends
// up selecting the "Recent Files" shortcut instead of taking you
// to the directory and file THAT YOU ASKED FOR!!! FUUUUK!!!
@@ -1287,12 +1286,12 @@ do_source_dialog(GtkButton *button, gboolean single, signal_user_data_t *ud)
// optimal because if you are processing several files in the same
// folder, you want the selection to return to where you were last
// in the list, but there's not much else I can do at this point.
+ //gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), sourcename);
+
gchar *dirname = g_path_get_dirname(sourcename);
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), dirname);
g_free(dirname);
-#else
- gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), sourcename);
-#endif
+
response = gtk_dialog_run(GTK_DIALOG (dialog));
gtk_widget_hide(dialog);
if (response == GTK_RESPONSE_NO)
@@ -3092,12 +3091,6 @@ ghb_backend_events(signal_user_data_t *ud)
gtk_label_set_text (label, status_str);
if (ghb_settings_get_boolean(ud->prefs, "show_status"))
{
-#if !GTK_CHECK_VERSION(2, 16, 0)
- GtkStatusIcon *si;
-
- si = GTK_STATUS_ICON(GHB_OBJECT(ud->builder, "hb_status"));
- gtk_status_icon_set_tooltip(si, status_str);
-#endif
#if defined(_USE_APP_IND)
char * ai_status_str= g_strdup_printf(
"%.2f%%",
@@ -3146,13 +3139,6 @@ ghb_backend_events(signal_user_data_t *ud)
100.0 * status.queue.progress);
app_indicator_set_label( ud->ai, ai_status_str, "99.99%");
g_free(ai_status_str);
-#else
-#if !GTK_CHECK_VERSION(2, 16, 0)
- GtkStatusIcon *si;
-
- si = GTK_STATUS_ICON(GHB_OBJECT(ud->builder, "hb_status"));
- gtk_status_icon_set_tooltip(si, status_str);
-#endif
#endif
}
gtk_label_set_text (work_status, status_str);
@@ -3235,13 +3221,6 @@ ghb_backend_events(signal_user_data_t *ud)
ud->cancel_encode = GHB_CANCEL_NONE;
#if defined(_USE_APP_IND)
app_indicator_set_label( ud->ai, "", "99.99%");
-#else
-#if !GTK_CHECK_VERSION(2, 16, 0)
- GtkStatusIcon *si;
-
- si = GTK_STATUS_ICON(GHB_OBJECT(ud->builder, "hb_status"));
- gtk_status_icon_set_tooltip(si, "HandBrake");
-#endif
#endif
}
else if (status.queue.state & GHB_STATE_MUXING)
@@ -3276,7 +3255,6 @@ ghb_backend_events(signal_user_data_t *ud)
}
}
-#if GTK_CHECK_VERSION(2, 16, 0)
G_MODULE_EXPORT gboolean
status_icon_query_tooltip_cb(
GtkStatusIcon *si,
@@ -3304,7 +3282,6 @@ status_icon_query_tooltip_cb(
g_free(status_str);
return TRUE;
}
-#endif
G_MODULE_EXPORT gboolean
ghb_timer_cb(gpointer data)
diff --git a/gtk/src/ghbcellrenderertext.c b/gtk/src/ghbcellrenderertext.c
index 3f8dcf5e8..0968ef360 100644
--- a/gtk/src/ghbcellrenderertext.c
+++ b/gtk/src/ghbcellrenderertext.c
@@ -38,12 +38,7 @@
#define GTK_PARAM_READWRITE G_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB
-#if GTK_CHECK_VERSION(3, 0, 0)
#define MyGdkRectangle const GdkRectangle
-#else
-#define MyGdkRectangle GdkRectangle
-#endif
-
static void ghb_cell_renderer_text_finalize (GObject *object);
@@ -62,23 +57,12 @@ static void ghb_cell_renderer_text_get_size (GtkCellRenderer *cell,
gint *y_offset,
gint *width,
gint *height);
-#if GTK_CHECK_VERSION(3, 0, 0)
static void ghb_cell_renderer_text_render (GtkCellRenderer *cell,
cairo_t *cr,
GtkWidget *widget,
MyGdkRectangle *background_area,
MyGdkRectangle *cell_area,
GtkCellRendererState flags);
-#else
-static void ghb_cell_renderer_text_render (GtkCellRenderer *cell,
- GdkWindow *window,
- GtkWidget *widget,
- MyGdkRectangle *background_area,
- MyGdkRectangle *cell_area,
- GdkRectangle *expose_area,
- GtkCellRendererState flags);
-#endif
-
static GtkCellEditable *ghb_cell_renderer_text_start_editing (GtkCellRenderer *cell,
GdkEvent *event,
GtkWidget *widget,
@@ -1635,7 +1619,6 @@ ghb_cell_renderer_text_get_size (GtkCellRenderer *cell,
x_offset, y_offset, width, height);
}
-#if GTK_CHECK_VERSION(3, 0, 0)
static void ghb_cell_renderer_text_render(
GtkCellRenderer *cell,
cairo_t *cr,
@@ -1713,98 +1696,6 @@ static void ghb_cell_renderer_text_render(
g_object_unref (layout);
}
-#else
-static void ghb_cell_renderer_text_render (GtkCellRenderer *cell,
- GdkWindow *window,
- GtkWidget *widget,
- MyGdkRectangle *background_area,
- MyGdkRectangle *cell_area,
- GdkRectangle *expose_area,
- GtkCellRendererState flags)
-{
- GhbCellRendererText *celltext = (GhbCellRendererText *) cell;
- PangoLayout *layout;
- GtkStateType state;
- gint x_offset;
- gint y_offset;
- GhbCellRendererTextPrivate *priv;
-
- priv = GHB_CELL_RENDERER_TEXT_GET_PRIVATE (cell);
-
- layout = get_layout (celltext, widget, TRUE, flags);
- get_size(cell, widget, cell_area, layout, &x_offset, &y_offset, NULL, NULL);
-
- gboolean sensitive;
- gint xpad, ypad;
-
- sensitive = gtk_cell_renderer_get_sensitive(cell);
- if (!sensitive)
- {
- state = GTK_STATE_INSENSITIVE;
- }
- else if ((flags & GTK_CELL_RENDERER_SELECTED) == GTK_CELL_RENDERER_SELECTED)
- {
- if (gtk_widget_has_focus (widget))
- state = GTK_STATE_SELECTED;
- else
- state = GTK_STATE_ACTIVE;
- }
- else if ((flags & GTK_CELL_RENDERER_PRELIT) == GTK_CELL_RENDERER_PRELIT &&
- GTK_WIDGET_STATE (widget) == GTK_STATE_PRELIGHT)
- {
- state = GTK_STATE_PRELIGHT;
- }
- else
- {
- if (GTK_WIDGET_STATE (widget) == GTK_STATE_INSENSITIVE)
- state = GTK_STATE_INSENSITIVE;
- else
- state = GTK_STATE_NORMAL;
- }
-
- gtk_cell_renderer_get_padding(cell, &xpad, &ypad);
-
- if (celltext->background_set &&
- (flags & GTK_CELL_RENDERER_SELECTED) == 0)
- {
- cairo_t *cr = gdk_cairo_create (window);
-
- if (expose_area)
- {
- gdk_cairo_rectangle (cr, expose_area);
- cairo_clip (cr);
- }
-
- gdk_cairo_rectangle (cr, background_area);
- cairo_set_source_rgb (cr,
- celltext->background.red / 65535.,
- celltext->background.green / 65535.,
- celltext->background.blue / 65535.);
- cairo_fill (cr);
-
- cairo_destroy (cr);
- }
-
- if (priv->ellipsize_set && priv->ellipsize != PANGO_ELLIPSIZE_NONE)
- pango_layout_set_width (layout,
- (cell_area->width - x_offset - 2 * xpad) * PANGO_SCALE);
- else if (priv->wrap_width == -1)
- pango_layout_set_width (layout, -1);
-
- gtk_paint_layout (widget->style,
- window,
- state,
- TRUE,
- expose_area,
- widget,
- "cellrenderertext",
- cell_area->x + x_offset + xpad,
- cell_area->y + y_offset + ypad,
- layout);
-
- g_object_unref (layout);
-}
-#endif
static gboolean
ghb_cell_renderer_text_keypress(
diff --git a/gtk/src/ghbcompat.h b/gtk/src/ghbcompat.h
index fa9e10bec..4e95951b0 100644
--- a/gtk/src/ghbcompat.h
+++ b/gtk/src/ghbcompat.h
@@ -4,31 +4,6 @@
#include <gtk/gtk.h>
#include <gdk/gdk.h>
-#if !GTK_CHECK_VERSION(3, 0, 0)
-#include <gdk/gdkkeysyms.h>
-#endif
-
-#if !GTK_CHECK_VERSION(2, 22, 0)
-// Define any keys not defined by older GDK versions
-#define GDK_KEY_Delete GDK_Delete
-#define GDK_KEY_Return GDK_Return
-#define GDK_KEY_Down GDK_Down
-#define GDK_KEY_Up GDK_Up
-#endif
-
-#if !GTK_CHECK_VERSION(2, 20, 0)
-// Replace simple accessor functions added to newer gtk versions
-static inline void gtk_widget_set_realized(GtkWidget *widget, gboolean realized)
-{
- GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED);
-}
-
-static inline gboolean gtk_widget_get_realized(GtkWidget *widget)
-{
- return GTK_WIDGET_REALIZED(widget);
-}
-#endif
-
static inline PangoFontDescription* ghb_widget_get_font(GtkWidget *widget)
{
PangoFontDescription *font = NULL;
@@ -44,18 +19,11 @@ static inline PangoFontDescription* ghb_widget_get_font(GtkWidget *widget)
#else
font = gtk_style_context_get_font(style, GTK_STATE_FLAG_NORMAL);
#endif
-
-#else
- font = gtk_widget_get_style(widget)->font_desc;
#endif
return font;
}
-#if !GTK_CHECK_VERSION(3, 0, 0)
-#define gtk_widget_override_font gtk_widget_modify_font
-#endif
-
#if !GTK_CHECK_VERSION(3, 10, 0)
#define gtk_image_set_from_icon_name gtk_image_set_from_stock
#define GHB_PLAY_ICON "gtk-media-play"
diff --git a/gtk/src/ghbcompositor.c b/gtk/src/ghbcompositor.c
index 24d5a72f8..4e7353da3 100644
--- a/gtk/src/ghbcompositor.c
+++ b/gtk/src/ghbcompositor.c
@@ -47,7 +47,6 @@ static void ghb_compositor_realize (GtkWidget *widget);
static void ghb_compositor_unrealize (GtkWidget *widget);
static void ghb_compositor_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
-#if GTK_CHECK_VERSION(3, 0, 0)
static gboolean ghb_compositor_draw (GtkWidget *widget,
cairo_t *cr);
static void ghb_compositor_get_preferred_width(GtkWidget *widget,
@@ -56,12 +55,6 @@ static void ghb_compositor_get_preferred_width(GtkWidget *widget,
static void ghb_compositor_get_preferred_height(GtkWidget *widget,
gint *minimum_size,
gint *natural_size);
-#else
-static gboolean ghb_compositor_expose (GtkWidget *widget,
- GdkEventExpose *event);
-static void ghb_compositor_size_request (GtkWidget *widget,
- GtkRequisition *requisition);
-#endif
static void ghb_compositor_set_property (GObject *object,
guint prop_id,
const GValue *value,
@@ -104,14 +97,9 @@ ghb_compositor_class_init (GhbCompositorClass *class)
gobject_class->set_property = ghb_compositor_set_property;
gobject_class->get_property = ghb_compositor_get_property;
-#if GTK_CHECK_VERSION(3, 0, 0)
widget_class->draw = ghb_compositor_draw;
widget_class->get_preferred_width = ghb_compositor_get_preferred_width;
widget_class->get_preferred_height = ghb_compositor_get_preferred_height;
-#else
- widget_class->size_request = ghb_compositor_size_request;
- widget_class->expose_event = ghb_compositor_expose;
-#endif
widget_class->size_allocate = ghb_compositor_size_allocate;
widget_class->realize = ghb_compositor_realize;
@@ -503,12 +491,7 @@ ghb_compositor_realize (GtkWidget *widget)
GdkWindow *window;
if (visible_window)
{
-#if GTK_CHECK_VERSION(3, 0, 0)
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
-#else
- attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
- attributes.colormap = gtk_widget_get_colormap (widget);
-#endif
attributes.visual = gtk_widget_get_visual (widget);
attributes.wclass = GDK_INPUT_OUTPUT;
@@ -524,14 +507,6 @@ ghb_compositor_realize (GtkWidget *widget)
gtk_widget_set_window(widget, window);
g_object_ref (window);
}
-
-#if !GTK_CHECK_VERSION(3, 0, 0)
- gtk_widget_style_attach(widget);
-
- if (visible_window)
- gtk_style_set_background(widget->style, window,
- GTK_STATE_NORMAL);
-#endif
}
static void
@@ -540,7 +515,6 @@ ghb_compositor_unrealize (GtkWidget *widget)
GTK_WIDGET_CLASS (ghb_compositor_parent_class)->unrealize (widget);
}
-#if GTK_CHECK_VERSION(3, 0, 0)
static void
ghb_compositor_get_preferred_width(
GtkWidget *widget,
@@ -592,35 +566,6 @@ ghb_compositor_get_preferred_height(
*minimum_size = height + gtk_container_get_border_width(GTK_CONTAINER (widget)) * 2;
*natural_size = height + gtk_container_get_border_width(GTK_CONTAINER (widget)) * 2;
}
-#else
-
-static void
-ghb_compositor_size_request(
- GtkWidget *widget,
- GtkRequisition *requisition)
-{
- GhbCompositor *compositor = GHB_COMPOSITOR (widget);
- GList *link;
- GhbCompositorChild *cc;
- gint width = 0, height = 0;
- GtkRequisition size;
-
- for (link = compositor->children; link != NULL; link = link->next)
- {
- cc = (GhbCompositorChild*)link->data;
- if (gtk_widget_get_visible(cc->widget))
- {
- //gtk_widget_size_request(cc->widget, NULL);
- gtk_widget_size_request(cc->widget, &size);
- width = MAX(size.width, width);
- height = MAX(size.height, height);
- }
- }
-
- requisition->width = width + gtk_container_get_border_width(GTK_CONTAINER (widget)) * 2;
- requisition->height = height + gtk_container_get_border_width(GTK_CONTAINER (widget)) * 2;
-}
-#endif
static void
ghb_compositor_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
@@ -687,7 +632,6 @@ static void showrects(cairo_region_t *region)
}
#endif
-#if GTK_CHECK_VERSION(3, 0, 0)
static void
ghb_compositor_blend (GtkWidget *widget, cairo_t *cr)
{
@@ -753,62 +697,7 @@ ghb_compositor_blend (GtkWidget *widget, cairo_t *cr)
}
/* we're done */
}
-#else
-static void
-ghb_compositor_blend (GtkWidget *widget, GdkEventExpose *event)
-{
- GhbCompositor *compositor = GHB_COMPOSITOR (widget);
- GList *link, *draw;
- GdkRegion *region;
- GtkWidget *child;
- cairo_t *cr;
- GhbCompositorChild *cc;
-
- if (compositor->children == NULL) return;
- /* create a cairo context to draw to the window */
- cr = gdk_cairo_create (gtk_widget_get_window(widget));
-
- for (link = compositor->children; link != NULL; link = link->next)
- {
-
- cc = (GhbCompositorChild*)link->data;
- for (draw = cc->drawables; draw != NULL; draw = draw->next)
- {
- /* get our child */
- child = GTK_WIDGET(draw->data);
- if (!gtk_widget_get_visible(cc->widget) ||
- !gtk_widget_get_visible(child))
- continue;
-
- /* the source data is the (composited) event box */
- gdk_cairo_set_source_pixmap (cr, gtk_widget_get_window(child),
- child->allocation.x,
- child->allocation.y);
- /* draw no more than our expose event intersects our child */
- region = gdk_region_rectangle (&child->allocation);
- gdk_region_intersect (region, event->region);
-
- GdkRegion *dregion = gdk_drawable_get_visible_region(
- gtk_widget_get_window(child));
- gdk_region_offset(dregion, child->allocation.x, child->allocation.y);
- gdk_region_intersect (region, dregion);
- gdk_region_destroy(dregion);
-
- gdk_cairo_region (cr, region);
- gdk_region_destroy(region);
- cairo_clip (cr);
- /* composite, with an opacity */
- cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
- cairo_paint_with_alpha (cr, cc->opacity);
- gdk_cairo_reset_clip(cr, gtk_widget_get_window(widget));
- }
- }
- /* we're done */
- cairo_destroy (cr);
-}
-#endif
-#if GTK_CHECK_VERSION(3, 0, 0)
static gboolean
ghb_compositor_draw(GtkWidget *widget, cairo_t *cr)
{
@@ -822,19 +711,3 @@ ghb_compositor_draw(GtkWidget *widget, cairo_t *cr)
return FALSE;
}
-#else
-static gboolean
-ghb_compositor_expose (GtkWidget *widget, GdkEventExpose *event)
-{
- if (GTK_WIDGET_DRAWABLE (widget))
- {
- if (gtk_widget_get_has_window(widget))
- ghb_compositor_blend (widget, event);
-
- GTK_WIDGET_CLASS(
- ghb_compositor_parent_class)->expose_event(widget, event);
- }
-
- return FALSE;
-}
-#endif
diff --git a/gtk/src/main.c b/gtk/src/main.c
index 8dd89e3ef..a4357c1fb 100644
--- a/gtk/src/main.c
+++ b/gtk/src/main.c
@@ -699,7 +699,6 @@ G_MODULE_EXPORT void x264_option_changed_cb(GtkWidget *widget, signal_user_data_
G_MODULE_EXPORT void position_overlay_cb(GtkWidget *widget, signal_user_data_t *ud);
G_MODULE_EXPORT void preview_hud_size_alloc_cb(GtkWidget *widget, signal_user_data_t *ud);
-#if GTK_CHECK_VERSION(3, 0, 0)
const gchar *MyCSS =
" \n\
GtkRadioButton .button { \n\
@@ -777,41 +776,7 @@ GtkEntry { \n\
} \n\
";
-#else
-// Some style definitions for the preview window and hud
-const gchar *hud_rcstyle =
-"style \"ghb-entry\" {\n"
-"GtkEntry::inner-border = {2,2,1,1}\n"
-"}\n"
-"style \"ghb-combo\" {\n"
-"xthickness = 1\n"
-"ythickness = 1\n"
-"}\n"
-"style \"ghb-preview\" {\n"
-"bg[NORMAL]=\"black\"\n"
-"}\n"
-"style \"ghb-hud\" {\n"
-"bg[NORMAL]=\"gray18\"\n"
-"bg[ACTIVE]=\"gray32\"\n"
-"bg[PRELIGHT]=\"gray46\"\n"
-"bg[SELECTED]=\"black\"\n"
-"base[NORMAL]=\"gray40\"\n"
-"text[NORMAL]=\"white\"\n"
-"text[ACTIVE]=\"white\"\n"
-"fg[NORMAL]=\"white\"\n"
-"fg[ACTIVE]=\"white\"\n"
-"fg[PRELIGHT]=\"white\"\n"
-"}\n"
-"widget_class \"*.GtkComboBox.GtkToggleButton\" style \"ghb-combo\"\n"
-"widget_class \"*.GtkScaleButton\" style \"ghb-combo\"\n"
-"widget_class \"*.GtkEntry\" style \"ghb-entry\"\n"
-"widget \"preview_window.*.preview_hud.*\" style \"ghb-hud\"\n"
-"widget \"preview_window\" style \"ghb-preview\"\n";
-#endif
-
-#if GTK_CHECK_VERSION(2, 16, 0)
extern G_MODULE_EXPORT void status_icon_query_tooltip_cb(void);
-#endif
int
main(int argc, char *argv[])
@@ -850,7 +815,6 @@ main(int argc, char *argv[])
gtk_init(&argc, &argv);
-#if GTK_CHECK_VERSION(3, 0, 0)
GtkCssProvider *css = gtk_css_provider_new();
error = NULL;
gtk_css_provider_load_from_data(css, MyCSS, -1, &error);
@@ -865,9 +829,6 @@ main(int argc, char *argv[])
g_warning("%s: %s", G_STRFUNC, error->message);
g_clear_error(&error);
}
-#else
- gtk_rc_parse_string(hud_rcstyle);
-#endif
#if !defined(_WIN32)
notify_init("HandBrake");
@@ -932,7 +893,7 @@ main(int argc, char *argv[])
draw = GHB_WIDGET(ud->builder, "preview_image_align");
hud = GHB_WIDGET(ud->builder, "preview_hud");
-#if 0 // wGTK_CHECK_VERSION(3, 0, 0)
+#if 0 // GTK_CHECK_VERSION(3, 0, 0)
// This uses the new GtkOverlay widget.
//
// Unfortunately, GtkOverlay is broken in a couple of ways.
@@ -1113,40 +1074,14 @@ main(int argc, char *argv[])
gtk_status_icon_set_visible(si,
ghb_settings_get_boolean(ud->prefs, "show_status"));
-#if GTK_CHECK_VERSION(2, 16, 0)
gtk_status_icon_set_has_tooltip(si, TRUE);
g_signal_connect(si, "query-tooltip",
status_icon_query_tooltip_cb, ud);
-#else
- gtk_status_icon_set_tooltip(si, "HandBrake");
-#endif
-#endif
-
- // Ugly hack to keep subtitle table from bouncing around as I change
- // which set of controls are visible
- gint width, height;
-#if GTK_CHECK_VERSION(3, 0, 0)
- GtkRequisition min_size, size;
-
- widget = GHB_WIDGET(ud->builder, "SrtCodeset");
- gtk_widget_get_preferred_size( widget, &min_size, &size );
- height = MAX(min_size.height, size.height);
- widget = GHB_WIDGET(ud->builder, "srt_code_label");
- gtk_widget_get_preferred_size( widget, &min_size, &size );
- height += MAX(min_size.height, size.height);
-#else
- GtkRequisition size;
-
- widget = GHB_WIDGET(ud->builder, "SrtCodeset");
- gtk_widget_size_request( widget, &size );
- height = size.height;
- widget = GHB_WIDGET(ud->builder, "srt_code_label");
- gtk_widget_size_request( widget, &size );
- height += size.height;
#endif
widget = GHB_WIDGET(ud->builder, "hb_window");
+ gint width, height;
GdkGeometry geo = {
-1, -1, 1024, 768, -1, -1, 10, 10, 0, 0, GDK_GRAVITY_NORTH_WEST
};
diff --git a/gtk/src/preview.c b/gtk/src/preview.c
index a77c7e018..e5f697810 100644
--- a/gtk/src/preview.c
+++ b/gtk/src/preview.c
@@ -156,13 +156,8 @@ ghb_preview_init(signal_user_data_t *ud)
ud->preview = g_malloc0(sizeof(preview_t));
ud->preview->view = GHB_WIDGET(ud->builder, "preview_image");
gtk_widget_realize(ud->preview->view);
-#if GTK_CHECK_VERSION(3, 0, 0)
g_signal_connect(G_OBJECT(ud->preview->view), "draw",
G_CALLBACK(preview_expose_cb), ud);
-#else
- g_signal_connect(G_OBJECT(ud->preview->view), "expose_event",
- G_CALLBACK(preview_expose_cb), ud);
-#endif
ud->preview->pause = TRUE;
ud->preview->encode_frame = -1;
@@ -174,7 +169,6 @@ ghb_preview_init(signal_user_data_t *ud)
GstBus *bus;
GstElement *xover;
-#if GTK_CHECK_VERSION(2,18,0)
if (!gdk_window_ensure_native(gtk_widget_get_window(ud->preview->view)))
{
g_message("Couldn't create native window for GstXOverlay. Disabling live preview.");
@@ -184,7 +178,6 @@ ghb_preview_init(signal_user_data_t *ud)
gtk_widget_hide (widget);
return;
}
-#endif
#if !defined(_WIN32)
ud->preview->xid = GDK_WINDOW_XID(gtk_widget_get_window(ud->preview->view));
@@ -1045,7 +1038,10 @@ delayed_expose_cb(signal_user_data_t *ud)
#endif
#endif
-#if GTK_CHECK_VERSION(3, 0, 0)
+#if 0 // GTK_CHECK_VERSION(3, 0, 0)
+//
+// Only needed if the problems with GtkOverlay are ever resolved
+//
G_MODULE_EXPORT gboolean
position_overlay_cb(
GtkWidget *overlay,
@@ -1422,7 +1418,6 @@ preview_motion_cb(
return FALSE;
}
-#if GTK_CHECK_VERSION(3, 0, 0)
cairo_region_t*
ghb_curved_rect_mask(gint width, gint height, gint radius)
{
@@ -1471,54 +1466,6 @@ ghb_curved_rect_mask(gint width, gint height, gint radius)
return shape;
}
-#else
-GdkDrawable*
-ghb_curved_rect_mask(gint width, gint height, gint radius)
-{
- GdkDrawable *shape;
- cairo_t *cr;
- double w, h;
-
- if (!width || !height)
- return NULL;
-
- shape = (GdkDrawable *)gdk_pixmap_new (NULL, width, height, 1);
-
- cr = gdk_cairo_create (shape);
-
- w = width;
- h = height;
- if (radius > width / 2)
- radius = width / 2;
- if (radius > height / 2)
- radius = height / 2;
-
- // fill shape with black
- cairo_save(cr);
- cairo_rectangle (cr, 0, 0, width, height);
- cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
- cairo_fill (cr);
- cairo_restore (cr);
-
- cairo_move_to (cr, 0, radius);
- cairo_curve_to (cr, 0 , 0, 0 , 0, radius, 0);
- cairo_line_to (cr, w - radius, 0);
- cairo_curve_to (cr, w, 0, w, 0, w, radius);
- cairo_line_to (cr, w , h - radius);
- cairo_curve_to (cr, w, h, w, h, w - radius, h);
- cairo_line_to (cr, 0 + radius, h);
- cairo_curve_to (cr, 0, h, 0, h, 0, h - radius);
-
- cairo_close_path(cr);
-
- cairo_set_source_rgb(cr, 1, 1, 1);
- cairo_fill(cr);
-
- cairo_destroy(cr);
-
- return shape;
-}
-#endif
G_MODULE_EXPORT void
preview_hud_size_alloc_cb(
@@ -1526,11 +1473,7 @@ preview_hud_size_alloc_cb(
GtkAllocation *allocation,
signal_user_data_t *ud)
{
-#if GTK_CHECK_VERSION(3, 0, 0)
cairo_region_t *shape;
-#else
- GdkDrawable *shape;
-#endif
//g_message("preview_hud_size_alloc_cb()");
if (gtk_widget_get_visible(widget) && allocation->height > 50)
@@ -1539,13 +1482,8 @@ preview_hud_size_alloc_cb(
allocation->height, allocation->height/4);
if (shape != NULL)
{
-#if GTK_CHECK_VERSION(3, 0, 0)
gtk_widget_shape_combine_region(widget, shape);
cairo_region_destroy(shape);
-#else
- gtk_widget_shape_combine_mask(widget, shape, 0, 0);
- gdk_pixmap_unref(shape);
-#endif
}
}
}
diff --git a/gtk/src/queuehandler.c b/gtk/src/queuehandler.c
index 385160e06..36094deb5 100644
--- a/gtk/src/queuehandler.c
+++ b/gtk/src/queuehandler.c
@@ -1763,55 +1763,27 @@ ghb_queue_buttons_grey(signal_user_data_t *ud)
if (show_stop)
{
gtk_widget_set_sensitive (widget, TRUE);
-#if GTK_CHECK_VERSION(2, 16, 0)
gtk_menu_item_set_label(GTK_MENU_ITEM(widget), _("S_top Queue"));
gtk_widget_set_tooltip_text(widget, _("Stop Encoding"));
-#else
- g_object_set_property(G_OBJECT(widget), "label",
- ghb_string_value(_("S_top Queue")));
- g_object_set_property(G_OBJECT(widget), "tooltip",
- ghb_string_value(_("Stop Encoding")));
-#endif
}
else
{
gtk_widget_set_sensitive (widget, show_start);
-#if GTK_CHECK_VERSION(2, 16, 0)
gtk_menu_item_set_label(GTK_MENU_ITEM(widget), _("_Start Queue"));
gtk_widget_set_tooltip_text(widget, _("Start Encoding"));
-#else
- g_object_set_property(G_OBJECT(widget), "label",
- ghb_string_value(_("_Start Queue")));
- g_object_set_property(G_OBJECT(widget), "tooltip",
- ghb_string_value(_("Start Encoding")));
-#endif
}
widget = GHB_WIDGET (ud->builder, "queue_pause_menu");
if (paused)
{
gtk_widget_set_sensitive (widget, show_start);
-#if GTK_CHECK_VERSION(2, 16, 0)
gtk_menu_item_set_label(GTK_MENU_ITEM(widget), "_Resume Queue");
gtk_widget_set_tooltip_text(widget, "Resume Encoding");
-#else
- g_object_set_property(G_OBJECT(widget), "label",
- ghb_string_value(_("_Resume Queue")));
- g_object_set_property(G_OBJECT(widget), "tooltip",
- ghb_string_value(_("Resume Encoding")));
-#endif
}
else
{
gtk_widget_set_sensitive (widget, show_stop);
-#if GTK_CHECK_VERSION(2, 16, 0)
gtk_menu_item_set_label(GTK_MENU_ITEM(widget), _("_Pause Queue"));
gtk_widget_set_tooltip_text(widget, _("Pause Encoding"));
-#else
- g_object_set_property(G_OBJECT(widget), "label",
- ghb_string_value(_("_Pause Queue")));
- g_object_set_property(G_OBJECT(widget), "tooltip",
- ghb_string_value(_("Pause Encoding")));
-#endif
}
}
diff --git a/gtk/src/renderer_button.c b/gtk/src/renderer_button.c
index 50e53dfe6..1eb140831 100644
--- a/gtk/src/renderer_button.c
+++ b/gtk/src/renderer_button.c
@@ -1,11 +1,7 @@
#include "marshalers.h"
#include "renderer_button.h"
-#if GTK_CHECK_VERSION(3, 0, 0)
#define MyGdkRectangle const GdkRectangle
-#else
-#define MyGdkRectangle GdkRectangle
-#endif
/* Some boring function declarations: GObject type system stuff */
static void custom_cell_renderer_button_init (CustomCellRendererButton *cellprogress);