Ejemplo n.º 1
0
			public override void Paint (IntPtr style, IntPtr window, GdkRectangle area, IntPtr widget, int x, int y, int width, int height, GtkPlus gtkPlus)
			{
				GtkShadowType shadow_type;
				switch (state) {
				case GtkPlusState.Disabled:
					shadow_type = GtkShadowType.GTK_SHADOW_ETCHED_IN;
					break;
				case GtkPlusState.Pressed:
					shadow_type = GtkShadowType.GTK_SHADOW_IN;
					break;
				default:
					shadow_type = GtkShadowType.GTK_SHADOW_OUT;
					break;
				}
				gtk_paint_box (
					gtkPlus.combo_box_drop_down_toggle_button_style,
					window,
					(GtkStateType)state,
					shadow_type,
					ref area,
					gtkPlus.combo_box_drop_down_toggle_button,
					"button",
					x, y, width, height);
				GtkMisc misc = (GtkMisc)Marshal.PtrToStructure (gtkPlus.combo_box_drop_down_arrow, typeof (GtkMisc));
				int extent = (int)(Math.Min (width - misc.xpad * 2, height - misc.ypad * 2) * GetWidgetStyleSingle (gtkPlus.combo_box_drop_down_arrow, "arrow-scaling"));
				gtk_paint_arrow (
				    gtkPlus.combo_box_drop_down_arrow_style,
				    window,
				    (GtkStateType)state,
				    GtkShadowType.GTK_SHADOW_NONE,
				    ref area,
				    gtkPlus.combo_box_drop_down_arrow,
				    "arrow",
				    GtkArrowType.GTK_ARROW_DOWN,
				    true,
				    (int)Math.Floor (x + misc.xpad + (width - extent) * misc.xalign),
					(int)Math.Floor (y + misc.ypad + (height - extent) * misc.yalign),
					extent, extent);
			}
Ejemplo n.º 2
0
			public override void Paint (IntPtr style, IntPtr window, GdkRectangle area, IntPtr widget, int x, int y, int width, int height, GtkPlus gtkPlus)
			{
				gtk_paint_shadow (
					style,
					window,
					 GtkStateType.GTK_STATE_NORMAL,
					 GtkShadowType.GTK_SHADOW_IN,
					 ref area,
					 widget,
					 "combobox",
					 x, y, width, height);
			}
Ejemplo n.º 3
0
			public override void Paint (IntPtr style, IntPtr window, GdkRectangle area, IntPtr widget, int x, int y, int width, int height, GtkPlus gtkPlus)
			{
				gtk_paint_resize_grip (
					style,
					window,
					GtkStateType.GTK_STATE_NORMAL,
					ref area,
					widget,
					"statusbar",
					GdkWindowEdge.GDK_WINDOW_EDGE_SOUTH_EAST,
					x, y, width, height);
			}
Ejemplo n.º 4
0
			public override void Paint (IntPtr style, IntPtr window, GdkRectangle area, IntPtr widget, int x, int y, int width, int height, GtkPlus gtkPlus)
			{
				gtk_paint_shadow (
				    style,
				    window,
				    GtkStateType.GTK_STATE_NORMAL,
				    GtkShadowType.GTK_SHADOW_IN,
				    ref area,
				    widget,
				    "entry",
				    x, y, width, height);
				GtkStyle style_structure = (GtkStyle)Marshal.PtrToStructure (style, typeof (GtkStyle));
				x += style_structure.xthickness;
				y += style_structure.ythickness;
				width -= 2 * style_structure.xthickness;
				height -= 2 * style_structure.ythickness;
				gtk_paint_flat_box (
				    style,
				    window,
				    (GtkStateType)state,
				    GtkShadowType.GTK_SHADOW_NONE,
				    ref area,
				    widget,
				    "entry_bg",
				    x, y, width, height);
			}
Ejemplo n.º 5
0
			public override void Paint (IntPtr style, IntPtr window, GdkRectangle area, IntPtr widget, int x, int y, int width, int height, GtkPlus gtkPlus)
			{
				gboolean can_focus;
				g_object_get (widget, "can-focus", out can_focus, IntPtr.Zero);
				if (can_focus) {
				    int focus_line_width;
				    int focus_padding;
				    gtk_widget_style_get (widget,
				        "focus-line-width", out focus_line_width,
				        "focus-padding", out focus_padding,
				        IntPtr.Zero);
				    int focus_width = focus_line_width + focus_padding;
				    if (horizontal) {
				        y -= focus_width;
				        height -= 2 * focus_width;
				    } else {
				        x -= focus_width;
				        width -= 2 * focus_width;
				    }
				}
				GtkShadowType shadow_type = state == GtkPlusState.Pressed ? GtkShadowType.GTK_SHADOW_IN : GtkShadowType.GTK_SHADOW_OUT;
				string detail = horizontal ? "hscrollbar" : "vscrollbar";
				gtk_paint_box (
					style,
					window,
					(GtkStateType)state,
					shadow_type,
					ref area,
					widget,
					detail,
					x, y, width, height);
				width /= 2;
				height /= 2;
				x += width / 2;
				y += height / 2;
				if (state == GtkPlusState.Pressed) {
				    int arrow_displacement_x;
				    int arrow_displacement_y;
				    gtk_widget_style_get (widget,
				        "arrow-displacement-x", out arrow_displacement_x,
				        "arrow-displacement-y", out arrow_displacement_y,
				        IntPtr.Zero);
				    x += arrow_displacement_x;
				    y += arrow_displacement_y;
				}
				gtk_paint_arrow (
					style,
					window,
					(GtkStateType)state,
					shadow_type,
					ref area,
					widget,
					detail,
					horizontal ? up_or_left ? GtkArrowType.GTK_ARROW_LEFT : GtkArrowType.GTK_ARROW_RIGHT : up_or_left ? GtkArrowType.GTK_ARROW_UP : GtkArrowType.GTK_ARROW_DOWN,
					true,
					x, y, width, height);
			}
Ejemplo n.º 6
0
			public override void Paint (IntPtr style, IntPtr window, GdkRectangle area, IntPtr widget, int x, int y, int width, int height, GtkPlus gtkPlus)
			{
				gtk_paint_box (
					style,
					window,
					state == GtkPlusState.Pressed ? GtkStateType.GTK_STATE_ACTIVE : GtkStateType.GTK_STATE_INSENSITIVE,
					GtkShadowType.GTK_SHADOW_IN,
					ref area,
					widget,
					GetWidgetStyleBoolean (widget, "trough-side-details") ? 
					up_or_left ? "trough-upper" : "trough-lower" :
					"trough",
					x, y, width, height);
			}
Ejemplo n.º 7
0
			public override void Paint (IntPtr style, IntPtr window, GdkRectangle area, IntPtr widget, int x, int y, int width, int height, GtkPlus gtkPlus)
			{
				GtkShadowType shadow_type = GetWidgetStyleShadowType (widget);
				if (shadow_type != GtkShadowType.GTK_SHADOW_NONE)
					gtk_paint_box (
						style,
						window,
						GtkStateType.GTK_STATE_NORMAL,
						shadow_type,
						ref area,
						widget,
						"spinbutton",
						x, y - (up ? 0 : height), width, height * 2);
				shadow_type = state == GtkPlusState.Pressed ? GtkShadowType.GTK_SHADOW_IN : GtkShadowType.GTK_SHADOW_OUT;
				gtk_paint_box (
				    style,
				    window,
				    (GtkStateType)state,
				    shadow_type,
				    ref area,
				    widget,
				    up ? "spinbutton_up" : "spinbutton_down",
				    x, y, width, height);
				if (up)
					y += 2;
				height -= 2;
				width -= 3;
				x += 1;
				int w = width / 2;
				w -= w % 2 - 1;
				int h = (w + 1) / 2;
				x += (width - w) / 2;
				y += (height - h) / 2;
				height = h;
				width = w;
				gtk_paint_arrow (
				    style,
				    window,
				    (GtkStateType)state,
				    shadow_type,
				    ref area,
				    widget,
				    "spinbutton",
				    up ? GtkArrowType.GTK_ARROW_UP : GtkArrowType.GTK_ARROW_DOWN,
				    true,
				    x, y, width, height);
			}
Ejemplo n.º 8
0
			public override void Paint (IntPtr style, IntPtr window, GdkRectangle area, IntPtr widget, int x, int y, int width, int height, GtkPlus gtkPlus)
			{
				gtk_paint_box (
					gtkPlus.tree_view_column_button_style,
					window,
					(GtkStateType)state,
					state == GtkPlusState.Pressed ? GtkShadowType.GTK_SHADOW_IN : GtkShadowType.GTK_SHADOW_OUT,
					ref area,
					gtkPlus.tree_view_column_button,
					"button",
					x, y, width, height);
			}
Ejemplo n.º 9
0
			public override void Paint (GtkStylePointer style, GdkWindowPointer window, GdkRectangle area, GtkWidgetPointer widget, gint x, gint y, gint width, gint height, GtkPlus gtkPlus)
			{
				gtk_paint_box (
					gtkPlus.tool_bar_toggle_button_style,
					window,
					GtkStateType.GTK_STATE_ACTIVE,
					GtkShadowType.GTK_SHADOW_IN,
					ref area,
					gtkPlus.tool_bar_toggle_button,
					"button",
					x, y, width, height);
			}
Ejemplo n.º 10
0
			public override void Paint (IntPtr style, IntPtr window, GdkRectangle area, IntPtr widget, int x, int y, int width, int height, GtkPlus gtkPlus)
			{
				gtk_paint_expander (
					style,
					window,
					GtkStateType.GTK_STATE_NORMAL,
					ref area,
					widget,
					"treeview",
					x + width / 2,
					y + height / 2,
					closed ? GtkExpanderStyle.GTK_EXPANDER_COLLAPSED : GtkExpanderStyle.GTK_EXPANDER_EXPANDED);
			}
Ejemplo n.º 11
0
			public override void AttachStyle (WidgetType widgetType, IntPtr drawable, GtkPlus gtkPlus)
			{
				gtkPlus.tool_bar_toggle_button_style = gtk_style_attach (gtkPlus.tool_bar_toggle_button_style, drawable);
			}
Ejemplo n.º 12
0
			public override void Paint (GtkStylePointer style, GdkWindowPointer window, GdkRectangle area, GtkWidgetPointer widget, gint x, gint y, gint width, gint height, GtkPlus gtkPlus)
			{
				gtk_paint_box (
					gtkPlus.tool_bar_button_style,
					window,
					(GtkStateType)state,
					state == GtkPlusState.Pressed ? GtkShadowType.GTK_SHADOW_IN : GtkShadowType.GTK_SHADOW_OUT,
					ref area,
					gtkPlus.tool_bar_button,
					"button",
					x, y, width, height);
			}
Ejemplo n.º 13
0
			public override void Paint (IntPtr style, IntPtr window, GdkRectangle area, IntPtr widget, int x, int y, int width, int height, GtkPlus gtkPlus)
			{
				gtk_paint_box (
					style,
					window,
					GtkStateType.GTK_STATE_NORMAL,
					GetWidgetStyleShadowType (widget),
					ref area,
					widget,
					"toolbar",
					x, y, width, height);
			}
Ejemplo n.º 14
0
			public override void Paint (IntPtr style, IntPtr window, GdkRectangle area, IntPtr widget, int x, int y, int width, int height, GtkPlus gtkPlus)
			{
				gtk_paint_shadow (
					style,
					window,
					(GtkStateType)state,
					GtkShadowType.GTK_SHADOW_ETCHED_IN,
					ref area,
					widget,
					"frame",
					x, y, width, height);

			}
Ejemplo n.º 15
0
			public virtual void AttachStyle (WidgetType widgetType, GdkDrawablePointer drawable, GtkPlus gtkPlus)
			{
				gtkPlus.styles [(int)widgetType] = gtk_style_attach (gtkPlus.styles [(int)widgetType], drawable);
			}
Ejemplo n.º 16
0
			public override void AttachStyle (WidgetType widgetType, IntPtr drawable, GtkPlus gtkPlus)
			{
				gtkPlus.tree_view_column_button_style = gtk_style_attach (gtkPlus.tree_view_column_button_style, drawable);
			}
Ejemplo n.º 17
0
			public abstract void Paint (GtkStylePointer style, GdkWindowPointer window, GdkRectangle area, GtkWidgetPointer widget, gint x, gint y, gint width, gint height, GtkPlus gtkPlus);
Ejemplo n.º 18
0
			public override void Paint (IntPtr style, IntPtr window, GdkRectangle area, IntPtr widget, int x, int y, int width, int height, GtkPlus gtkPlus)
			{
				gtk_paint_box (
					style,
					window,
					GtkStateType.GTK_STATE_PRELIGHT,
					GtkShadowType.GTK_SHADOW_OUT,
					ref area,
					widget,
					"bar",
					x, y, width, height);
			}
Ejemplo n.º 19
0
			public override void Paint (GtkStylePointer style, GdkWindowPointer window, GdkRectangle area, GtkWidgetPointer widget, gint x, gint y, gint width, gint height, GtkPlus gtkPlus)
			{
				if (@default) {
					gtk_window_set_default (gtkPlus.window, widget);
					gtk_paint_box (
						style,
						window,
						GtkStateType.GTK_STATE_NORMAL,
						GtkShadowType.GTK_SHADOW_IN,
						ref area,
						widget,
						"buttondefault",
						x, y, width, height);
					gtk_window_set_default (gtkPlus.window, IntPtr.Zero);
				} else
					gtk_paint_box (
						style,
						window,
						(GtkStateType)state,
						state == GtkPlusState.Pressed ? GtkShadowType.GTK_SHADOW_IN : GtkShadowType.GTK_SHADOW_OUT,
						ref area,
						widget,
						"button",
						x, y, width, height);
			}
Ejemplo n.º 20
0
			public override void Paint (IntPtr style, IntPtr window, GdkRectangle area, IntPtr widget, int x, int y, int width, int height, GtkPlus gtkPlus)
			{
				gtk_paint_slider (
					style,
					window,
					(GtkStateType)state,
					state == GtkPlusState.Pressed && GetWidgetStyleBoolean (widget, "activate-slider") ? GtkShadowType.GTK_SHADOW_IN : GtkShadowType.GTK_SHADOW_OUT,
					ref area,
					widget,
					Detail,
					x, y, width, height,
					horizontal ? GtkOrientation.GTK_ORIENTATION_HORIZONTAL : GtkOrientation.GTK_ORIENTATION_VERTICAL);
			}
Ejemplo n.º 21
0
			public override void Paint (GtkStylePointer style, GdkWindowPointer window, GdkRectangle area, GtkWidgetPointer widget, gint x, gint y, gint width, gint height, GtkPlus gtkPlus)
			{
				PaintFunction (
					style,
					window,
					(GtkStateType)state,
					(GtkShadowType)value,
					ref area,
					widget,
					Detail,
					x, y, width,height);
			}
Ejemplo n.º 22
0
		public static bool Initialize ()
		{
			try {
				if (gtk_check_version (2, 10, 0) != IntPtr.Zero)
					return false;
				//TODO: If we need to pass the actual arguments, duplicate the required code from GTK#.
				int argc = 0;
				string [] argv = new string [1];
				bool result = gtk_init_check (ref argc, ref argv);
				if (result)
					instance = new GtkPlus ();
				return result;
			} catch (DllNotFoundException) {
				return false;
			}
		}
Ejemplo n.º 23
0
			public override void AttachStyle (WidgetType widgetType, IntPtr drawable, GtkPlus gtkPlus)
			{
				gtkPlus.combo_box_drop_down_toggle_button_style = gtk_style_attach (gtkPlus.combo_box_drop_down_toggle_button_style, drawable);
				gtkPlus.combo_box_drop_down_arrow_style = gtk_style_attach (gtkPlus.combo_box_drop_down_arrow_style, drawable);
			}
Ejemplo n.º 24
0
			public override void Paint (IntPtr style, IntPtr window, GdkRectangle area, IntPtr widget, int x, int y, int width, int height, GtkPlus gtkPlus)
			{
				gtk_paint_box_gap (
					style,
					window,
					GtkStateType.GTK_STATE_NORMAL,
					GtkShadowType.GTK_SHADOW_OUT,
					ref area,
					widget,
					"notebook",
					x, y, width, height,
					GtkPositionType.GTK_POS_TOP,
					0,
					0);
			}
Ejemplo n.º 25
0
			public override void Paint (IntPtr style, IntPtr window, GdkRectangle area, IntPtr widget, int x, int y, int width, int height, GtkPlus gtkPlus)
			{
				gtk_paint_extension (
					style,
					window,
					(GtkStateType)state,
					GtkShadowType.GTK_SHADOW_OUT,
					ref area,
					widget,
					"tab",
					x, y, width, height,
					GtkPositionType.GTK_POS_BOTTOM);
			}