Compare commits

..

115 Commits

Author SHA1 Message Date
Federico Mena Quintero 4278664e48 Remove inclusion of GTK+ compatibility header 2010-06-10 16:26:52 -05:00
Federico Mena Quintero 905a15445d Use the new names for the meta-*.h headers 2010-06-10 16:25:53 -05:00
Federico Mena Quintero deee9124a0 Move Mutter's files to be named meta-*.[ch] 2010-06-10 16:22:11 -05:00
Federico Mena Quintero 60d10a4e36 Strip down common.h to only the things we need
Types and macros which are not used in the theming code are removed.
2010-06-10 16:20:45 -05:00
Federico Mena Quintero 33b06d5733 Add common.h from Mutter 2010-06-10 16:20:19 -05:00
Federico Mena Quintero 4a37452434 Use g_debug() instead of meta_topic() 2010-06-10 15:58:48 -05:00
Federico Mena Quintero d279df9271 No need for util.h in gradient.c 2010-06-10 15:40:15 -05:00
Federico Mena Quintero 7cef42c934 Copy gradient.[ch] from Mutter's sources 2010-06-10 15:36:54 -05:00
Federico Mena Quintero 2a2795fe6e Remove usage of meta_rect()
This was just of the form

  MetaRectangle r = meta_rect (x, y, w, h);

But it was now superfluous in a couple of cases where we could
just use the GdkRectangle that we already had (i.e. without
having to create a new MetaRectangle), and in another
case where all fields were set to zero.

And lo and behold, we actually don't need any meta_rectangle_*()
functions in the theme code.
2010-06-10 15:17:31 -05:00
Federico Mena Quintero a56ab0ab98 Use GdkRectangle instead of MetaRectangle
Both use int x/y/width/height anyway.  We'll add whatever
meta_rectangle_*() functions are missing in GTK+ for
the theming code to work.
2010-06-10 15:12:20 -05:00
Federico Mena Quintero fd7629677e Copy the theme renderer and parser from Mutter's sources
We will refactor these to work for GTK+.
2010-06-10 14:59:23 -05:00
Federico Mena Quintero 8b2f6bc673 Merge remote branch 'origin/client-side-decorations' into client-side-decorations 2010-06-09 16:43:25 -05:00
Cody Russell 68a12cf28c RGBA blacklist support. 2010-06-08 17:39:05 -05:00
Federico Mena Quintero 6da936a452 Merge master into client-side-decorations 2010-06-08 15:30:19 -05:00
Cody Russell 213ff8fc05 Titlebar layout improvements. 2010-05-20 13:47:53 -05:00
Cody Russell d868d80b4e Setup the title icon correctly, fix runtime Gtk-CRITICAL error. 2010-05-19 21:36:28 -05:00
Cody Russell 7191af3f9d Remove xthickness from child_allocation.y to fix an unwanted line between the titlebar and content. 2010-05-19 19:22:06 -05:00
Cody Russell f48314129a Remove drop-shadow code. 2010-05-19 15:31:48 -05:00
Cody Russell 74352ac616 Add 'decoration-corner-radius' style property. 2010-05-19 15:25:32 -05:00
Cody Russell 77485eb9cc Improve draw queues to get rid of artifacts when resizing. 2010-05-19 15:12:57 -05:00
Cody Russell 1c4e5f25a6 gdk decoration management changes, performance improvements. 2010-05-19 10:37:52 -05:00
Cody Russell 1ce72571d5 Title label management improvements. 2010-05-19 09:47:38 -05:00
Cody Russell 069a6dba46 Add some support for styling, decoration button customization, and various fixes. 2010-05-19 09:31:57 -05:00
Cody Russell 63bc0d7f65 Fix up some errors from the rebase. 2010-04-16 14:17:52 -05:00
Kristian Høgsberg d3c392c8e3 Don't set a cursor if the widget doesn't specify one 2010-04-16 14:17:52 -05:00
Matthias Clasen 8bf348ee58 Trivial doc fixes 2010-04-16 14:17:52 -05:00
Cody Russell 5e1a2666f8 Fix so we can't set the parent on icon_event_box after its parent is already set. 2010-04-16 14:17:52 -05:00
Cody Russell 2d3ce9281c Mark create_blur_kernel() as static 2010-04-16 14:17:52 -05:00
Cody Russell c0892af0cf Add forward declaration of static function 2010-04-16 14:17:52 -05:00
Cody Russell 2810516dd5 Make gtk_window_set_client_side_decorations() a static function, remove from gtkwindow.h 2010-04-16 14:17:52 -05:00
Cody Russell b44d5bc864 Update some 'since' documentation 2010-04-16 14:17:52 -05:00
Cody Russell 2b4b4177e1 Add gtkwindow-decorate.[ch] again, but deprecate the symbols. 2010-04-16 14:17:52 -05:00
Cody Russell 7d69394c8d Improve some style property documentation 2010-04-16 14:17:52 -05:00
Cody Russell c39adf64aa Disable drop-shadows by default 2010-04-16 14:17:52 -05:00
Cody Russell 731388c376 Add GTK_WINDOW_REGION_SHADOW, and add support for shadow regions to get_region_type(). 2010-04-16 14:17:51 -05:00
Cody Russell d2a2bc374f Drop shadows 2010-04-16 14:17:51 -05:00
Cody Russell d1fca416e0 Fix some warnings. 2010-04-16 14:17:51 -05:00
Cody Russell 1ec3e7d9ba Don't draw the window frame when the window is maximized. 2010-04-16 14:17:51 -05:00
Cody Russell 558e2bc073 Improve the default style painting of the window when it is maximized by removing hmargin/vmargin and rounded corners. 2010-04-16 14:17:51 -05:00
Cody Russell 170d8bf584 Use RGBA by default, not just on GtkWindow 2010-04-16 14:17:51 -05:00
Cody Russell d2458cc41a extents WIP 2010-04-16 14:17:51 -05:00
Cody Russell acc1f888ac Make the window's popup more useful, with min/max/close features at least 2010-04-16 14:17:51 -05:00
Cody Russell e16f97df03 small fix 2010-04-16 14:17:51 -05:00
Cody Russell 7e174a8c4e cursor management changes 2010-04-16 14:17:51 -05:00
Cody Russell a571b168d7 add gdk_window_get_cursor() 2010-04-16 14:17:51 -05:00
Cody Russell 3fbf650536 remove oops :) 2010-04-16 14:17:51 -05:00
Cody Russell be24e12939 popup menu when clicking on the title icon 2010-04-16 14:17:51 -05:00
Cody Russell eb661febec basic right-click menu support 2010-04-16 14:17:51 -05:00
Cody Russell 1d61421cbe double-click toggles maximize window 2010-04-16 14:17:51 -05:00
Cody Russell 860b49cf51 handle PROP_DISABLE_CLIENT_SIDE_DECORATIONS in {get,set}_property methods 2010-04-16 14:17:51 -05:00
Cody Russell ce5a7d4cfb remove gtk_window_disable_client_side_decorations function, add construct-only property 2010-04-16 14:17:51 -05:00
Cody Russell 9ccc8fa2ee remove gtk_window_get_client_side_decorations() 2010-04-16 14:17:51 -05:00
Matthias Clasen 315bf62ec9 Ignore double-clicks 2010-04-16 14:17:51 -05:00
Matthias Clasen f44c76de5c Implement RTL flipping for window controls 2010-04-16 14:17:51 -05:00
Matthias Clasen 67c79563f3 Respect geometry hints
Only set cursors and start resizing if the geometry hints allow it.
Allow to 'shake loose' maximized windows.
2010-04-16 14:17:51 -05:00
Matthias Clasen 330d760a2d Redo region handling
Rewrite the region determination to be more symmetric. And don't
constantly set cursors.
2010-04-16 14:17:51 -05:00
Matthias Clasen 6cb831b9ed Make resize handles larger
There is now a ::decoration-resize-handle style property to control
the size of these handles; also clean up some confusion where the old
window->frame_width was used.
2010-04-16 14:17:51 -05:00
Cody Russell 4ef1a16536 remove decoration-button-size and ecoration-button-y-offset properties 2010-04-16 14:17:51 -05:00
Cody Russell 91b255034a ellipsize client-side title labels 2010-04-16 14:17:51 -05:00
Cody Russell d65909b168 change top/left/right/bottom properties to be just one border width property 2010-04-16 14:17:51 -05:00
Matthias Clasen 713996c69d Make switching from and to csd work 2010-04-16 14:17:51 -05:00
Matthias Clasen 1ed0ac92bf Add focus color
Redraw window frames on focus in and focus out and make
focused windows use the selection color for their frame.
2010-04-16 14:17:50 -05:00
Matthias Clasen d2dae1b01d Toggle the max button image
Show a different image in maximized state; this is common in window
manager themes.
2010-04-16 14:17:50 -05:00
Cody Russell e13f21b458 avoid calling is_client_side_decorated() multiple times in one function 2010-04-16 14:17:50 -05:00
Cody Russell 80979520e3 gtk_window_button_press_event() return FALSE at the end 2010-04-16 14:17:50 -05:00
Cody Russell e184fa85bf unset GTK_CAN_FOCUS flag on min/max/close buttons 2010-04-16 14:17:50 -05:00
Cody Russell e173e3f72b tooltip text on min/max/close buttons 2010-04-16 14:17:50 -05:00
Cody Russell aa0f5fb87d fix oops 2010-04-16 14:17:50 -05:00
Cody Russell d4c721a9e1 remove test code again 2010-04-16 14:17:50 -05:00
Cody Russell cd5ede55c9 add support for window icons 2010-04-16 14:17:50 -05:00
Cody Russell fe8ad4d746 hide and show min/max buttons based on GdmWMDecorations value 2010-04-16 14:17:50 -05:00
Cody Russell ea7b05024e check is_client_side_decorated() in ensure_title_box() 2010-04-16 14:17:50 -05:00
Cody Russell f0c0032171 only update mouse cursor to non-arrow if window is resizable 2010-04-16 14:17:50 -05:00
Cody Russell f5c141d746 no need for toggle logic in min_button_clicked() 2010-04-16 14:17:50 -05:00
Cody Russell c59a059551 remove some temporary code 2010-04-16 14:17:50 -05:00
Cody Russell a3ffbcacba add widget names so they can be accessed from the theme 2010-04-16 14:17:50 -05:00
Cody Russell 4bba6ac660 fix title setting bug 2010-04-16 14:17:50 -05:00
Cody Russell ceec85b195 fix GtkPlug to always force cs-decorations off 2010-04-16 14:17:50 -05:00
Cody Russell 0358e0d7f7 remove the rgba stuff for now for firefox; temp hack for is_client_side_decorated 2010-04-16 14:17:50 -05:00
Cody Russell b1ad5235b9 check for both ->client_side_decorated && ->decorated; motion/click only when not maximized 2010-04-16 14:17:50 -05:00
Cody Russell ad24eb34d5 remove unnecessary change 2010-04-16 14:17:50 -05:00
Cody Russell 3cb8bc456b allocate bin.child's x-position and height by MAX(title height, box height) 2010-04-16 14:17:50 -05:00
Cody Russell 72c57c1b64 fix a mistake in gtkwindow.h 2010-04-16 14:17:50 -05:00
Cody Russell 52276a1402 add container::remove interface 2010-04-16 14:17:50 -05:00
Cody Russell c284f256c7 button event handlers 2010-04-16 14:17:50 -05:00
Cody Russell 4a3a775aac add buttons 2010-04-16 14:17:50 -05:00
Cody Russell 842e7a216e remove frame event stuff 2010-04-16 14:17:50 -05:00
Cody Russell cab5f6e0d8 cursor support 2010-04-16 14:17:50 -05:00
Cody Russell 0e6e52c19b remove compute_child_allocation from GtkWindowClass 2010-04-16 14:17:50 -05:00
Cody Russell 50bcb86e64 differentiate between N edge and title in button_press_event 2010-04-16 14:17:49 -05:00
Cody Russell 0051be4ead simple window resizing 2010-04-16 14:17:49 -05:00
Kristian Høgsberg 906020a222 Invalidate window on size_allocate so we redraw correctly 2010-04-16 14:17:49 -05:00
Cody Russell c84c994a51 check for GDK_DECOR_BORDER before calculating frame size, use style properties for frame sizes 2010-04-16 14:17:49 -05:00
Kristian Høgsberg e7a8c9da41 Move drawing to gtkstyle.c, use colors from style 2010-04-16 14:17:49 -05:00
Kristian Høgsberg 5d9a615c49 Offset path by half a pixel so we get a nice thin line. 2010-04-16 14:17:49 -05:00
Cody Russell a741c53d23 check for -1 before setting 2010-04-16 14:17:49 -05:00
Cody Russell f77ee8dfa6 fix warnings, remove unneeded code 2010-04-16 14:17:49 -05:00
Cody Russell 3bc6bb7632 remove #include "gtkwindow-decorate.h" 2010-04-16 14:17:49 -05:00
Cody Russell 8f7bcc1a44 remove gtkwindow-decorate.[ch] 2010-04-16 14:17:49 -05:00
Cody Russell 2e632ce7e2 put title label in an hbox 2010-04-16 14:17:49 -05:00
Cody Russell 5a6b67b522 remove some old stuff 2010-04-16 14:17:49 -05:00
Cody Russell fbd4043137 fix sizing and other random changes 2010-04-16 14:17:49 -05:00
Cody Russell f8f39cd397 temporary window painting 2010-04-16 14:17:49 -05:00
Cody Russell 00a9aaa68c remove unnecessary event propagation from gtk_window_expose 2010-04-16 14:17:49 -05:00
Cody Russell ac23bb2577 size_allocate improvements 2010-04-16 14:17:49 -05:00
Cody Russell eacf3b4e8f fix window title 2010-04-16 14:17:49 -05:00
Cody Russell 70760bcca0 do stuff in GtkWindow 2010-04-16 14:17:49 -05:00
Cody Russell 1c0e449cbe container stuff 2010-04-16 14:17:49 -05:00
Cody Russell 4f750e2bec title label widget 2010-04-16 14:17:49 -05:00
Cody Russell d0a8a7268c wip 2010-04-16 14:17:49 -05:00
Cody Russell 895c8bb951 fixes for sizing 2010-04-16 14:17:49 -05:00
Cody Russell b418df3d9a wip 2010-04-16 14:17:48 -05:00
Carlos Garnacho 123cf65d4f Also resize GTK_WIDGET (window)->window on size_allocate. 2010-04-16 14:17:48 -05:00
Carlos Garnacho aa4ccd354c Fix typo. 2010-04-16 14:17:48 -05:00
Cody Russell 87d2a51f56 work in progress 2010-04-16 14:17:48 -05:00
35 changed files with 17806 additions and 369 deletions
+261
View File
@@ -0,0 +1,261 @@
<!-- ##### SECTION Title ##### -->
Drag and Drop
<!-- ##### SECTION Short_Description ##### -->
Functions for controlling drag and drop handling
<!-- ##### SECTION Long_Description ##### -->
<para>
These functions provide a low level interface for drag and drop.
The X backend of GDK supports both the Xdnd and Motif drag and drop protocols
transparently, the Win32 backend supports the WM_DROPFILES protocol.
</para>
<para>
GTK+ provides a higher level abstraction based on top of these functions,
and so they are not normally needed in GTK+ applications.
See the <link linkend="gtk-Drag-and-Drop">Drag and Drop</link> section of
the GTK+ documentation for more information.
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### SECTION Image ##### -->
<!-- ##### FUNCTION gdk_drag_get_selection ##### -->
<para>
</para>
@context:
@Returns:
<!-- ##### FUNCTION gdk_drag_abort ##### -->
<para>
</para>
@context:
@time_:
<!-- ##### FUNCTION gdk_drop_reply ##### -->
<para>
</para>
@context:
@ok:
@time_:
<!-- ##### FUNCTION gdk_drag_context_new ##### -->
<para>
</para>
@void:
@Returns:
<!-- ##### FUNCTION gdk_drag_drop ##### -->
<para>
</para>
@context:
@time_:
<!-- ##### FUNCTION gdk_drag_find_window ##### -->
<para>
</para>
@context:
@drag_window:
@x_root:
@y_root:
@dest_window:
@protocol:
<!-- ##### FUNCTION gdk_drag_find_window_for_screen ##### -->
<para>
</para>
@context:
@drag_window:
@screen:
@x_root:
@y_root:
@dest_window:
@protocol:
<!-- ##### FUNCTION gdk_drag_begin ##### -->
<para>
</para>
@window:
@targets:
@Returns:
<!-- ##### FUNCTION gdk_drag_motion ##### -->
<para>
</para>
@context:
@dest_window:
@protocol:
@x_root:
@y_root:
@suggested_action:
@possible_actions:
@time_:
@Returns:
<!-- ##### FUNCTION gdk_drop_finish ##### -->
<para>
</para>
@context:
@success:
@time_:
<!-- ##### FUNCTION gdk_drag_get_protocol ##### -->
<para>
</para>
@xid:
@protocol:
@Returns:
<!-- ##### FUNCTION gdk_drag_get_protocol_for_display ##### -->
<para>
</para>
@display:
@xid:
@protocol:
@Returns:
<!-- ##### ENUM GdkDragProtocol ##### -->
<para>
Used in #GdkDragContext to indicate the protocol according to
which DND is done.
</para>
@GDK_DRAG_PROTO_MOTIF: The Motif DND protocol.
@GDK_DRAG_PROTO_XDND: The Xdnd protocol.
@GDK_DRAG_PROTO_ROOTWIN: An extension to the Xdnd protocol for
unclaimed root window drops.
@GDK_DRAG_PROTO_NONE: no protocol.
@GDK_DRAG_PROTO_WIN32_DROPFILES: The simple WM_DROPFILES protocol.
@GDK_DRAG_PROTO_OLE2: The complex OLE2 DND protocol (not implemented).
@GDK_DRAG_PROTO_LOCAL: Intra-application DND.
<!-- ##### STRUCT GdkDragContext ##### -->
<para>
A <structname>GdkDragContext</structname> holds information about a
drag in progress. It is used on both source and destination sides.
</para>
@parent_instance: the parent instance
<!-- ##### ENUM GdkDragAction ##### -->
<para>
Used in #GdkDragContext to indicate what the destination
should do with the dropped data.
</para>
@GDK_ACTION_DEFAULT: Means nothing, and should not be used.
@GDK_ACTION_COPY: Copy the data.
@GDK_ACTION_MOVE: Move the data, i.e. first copy it, then delete
it from the source using the DELETE target of the X selection protocol.
@GDK_ACTION_LINK: Add a link to the data. Note that this is only
useful if source and destination agree on what it means.
@GDK_ACTION_PRIVATE: Special action which tells the source that the
destination will do something that the source doesn't understand.
@GDK_ACTION_ASK: Ask the user what to do with the data.
<!-- ##### FUNCTION gdk_drag_status ##### -->
<para>
</para>
@context:
@action:
@time_:
<!-- ##### FUNCTION gdk_drag_drop_succeeded ##### -->
<para>
</para>
@context:
@Returns:
<!-- ##### FUNCTION gdk_drag_context_get_action ##### -->
<para>
</para>
@context:
@Returns:
<!-- ##### FUNCTION gdk_drag_context_get_actions ##### -->
<para>
</para>
@context:
@Returns:
<!-- ##### FUNCTION gdk_drag_context_get_suggested_action ##### -->
<para>
</para>
@context:
@Returns:
<!-- ##### FUNCTION gdk_drag_context_list_targets ##### -->
<para>
</para>
@context:
@Returns:
<!-- ##### FUNCTION gdk_drag_context_get_device ##### -->
<para>
</para>
@context:
@Returns:
<!-- ##### FUNCTION gdk_drag_context_set_device ##### -->
<para>
</para>
@context:
@device:
+14
View File
@@ -144,6 +144,20 @@ expand_content_files = \
glossary.xml \
migrating-2to3.xml \
migrating-checklist.sgml \
migrating-ClientSideWindows.sgml \
migrating-GtkAction.sgml \
migrating-GtkComboBox.sgml \
migrating-GtkEntry-icons.sgml \
migrating-GtkFileChooser.sgml \
migrating-GtkIconView.sgml \
migrating-GtkAboutDialog.sgml \
migrating-GtkColorButton.sgml \
migrating-GtkAssistant.sgml \
migrating-GtkRecentChooser.sgml \
migrating-GtkLabel-links.sgml \
migrating-GtkLinkButton.sgml \
migrating-GtkBuilder.sgml \
migrating-GtkTooltip.sgml \
tree_widget.sgml \
text_widget.sgml \
question_index.sgml
+771
View File
@@ -0,0 +1,771 @@
<!-- ##### SECTION Title ##### -->
GtkIconView
<!-- ##### SECTION Short_Description ##### -->
A widget which displays a list of icons in a grid
<!-- ##### SECTION Long_Description ##### -->
<para>
#GtkIconView provides an alternative view on a list model.
It displays the model as a grid of icons with labels. Like
#GtkTreeView, it allows to select one or multiple items
(depending on the selection mode, see gtk_icon_view_set_selection_mode()).
In addition to selection with the arrow keys, #GtkIconView supports
rubberband selection, which is controlled by dragging the pointer.
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### SECTION Image ##### -->
<!-- ##### STRUCT GtkIconView ##### -->
<para>
The <structname>GtkIconView</structname> struct contains only
private fields and should not be directly accessed.
</para>
<!-- ##### SIGNAL GtkIconView::activate-cursor-item ##### -->
<para>
</para>
@iconview: the object which received the signal.
@Returns:
<!-- ##### SIGNAL GtkIconView::item-activated ##### -->
<para>
</para>
@iconview: the object which received the signal.
@arg1:
<!-- ##### SIGNAL GtkIconView::move-cursor ##### -->
<para>
</para>
@iconview: the object which received the signal.
@arg1:
@arg2:
@Returns:
<!-- ##### SIGNAL GtkIconView::select-all ##### -->
<para>
</para>
@iconview: the object which received the signal.
<!-- ##### SIGNAL GtkIconView::select-cursor-item ##### -->
<para>
</para>
@iconview: the object which received the signal.
<!-- ##### SIGNAL GtkIconView::selection-changed ##### -->
<para>
</para>
@iconview: the object which received the signal.
<!-- ##### SIGNAL GtkIconView::set-scroll-adjustments ##### -->
<para>
</para>
@iconview: the object which received the signal.
@arg1:
@arg2:
<!-- ##### SIGNAL GtkIconView::toggle-cursor-item ##### -->
<para>
</para>
@iconview: the object which received the signal.
<!-- ##### SIGNAL GtkIconView::unselect-all ##### -->
<para>
</para>
@iconview: the object which received the signal.
<!-- ##### ARG GtkIconView:column-spacing ##### -->
<para>
</para>
<!-- ##### ARG GtkIconView:columns ##### -->
<para>
</para>
<!-- ##### ARG GtkIconView:item-padding ##### -->
<para>
</para>
<!-- ##### ARG GtkIconView:item-width ##### -->
<para>
</para>
<!-- ##### ARG GtkIconView:margin ##### -->
<para>
</para>
<!-- ##### ARG GtkIconView:markup-column ##### -->
<para>
</para>
<!-- ##### ARG GtkIconView:model ##### -->
<para>
</para>
<!-- ##### ARG GtkIconView:orientation ##### -->
<para>
</para>
<!-- ##### ARG GtkIconView:pixbuf-column ##### -->
<para>
</para>
<!-- ##### ARG GtkIconView:reorderable ##### -->
<para>
</para>
<!-- ##### ARG GtkIconView:row-spacing ##### -->
<para>
</para>
<!-- ##### ARG GtkIconView:selection-mode ##### -->
<para>
</para>
<!-- ##### ARG GtkIconView:spacing ##### -->
<para>
</para>
<!-- ##### ARG GtkIconView:text-column ##### -->
<para>
</para>
<!-- ##### ARG GtkIconView:tooltip-column ##### -->
<para>
</para>
<!-- ##### ARG GtkIconView:selection-box-alpha ##### -->
<para>
</para>
<!-- ##### ARG GtkIconView:selection-box-color ##### -->
<para>
</para>
<!-- ##### USER_FUNCTION GtkIconViewForeachFunc ##### -->
<para>
A function used by gtk_icon_view_selected_foreach() to map all
selected rows. It will be called on every selected row in the view.
</para>
@icon_view: a #GtkIconView
@path: The #GtkTreePath of a selected row
@data: user data
<!-- ##### FUNCTION gtk_icon_view_new ##### -->
<para>
</para>
@void:
@Returns:
<!-- ##### FUNCTION gtk_icon_view_new_with_model ##### -->
<para>
</para>
@model:
@Returns:
<!-- ##### FUNCTION gtk_icon_view_set_model ##### -->
<para>
</para>
@icon_view:
@model:
<!-- ##### FUNCTION gtk_icon_view_get_model ##### -->
<para>
</para>
@icon_view:
@Returns:
<!-- ##### FUNCTION gtk_icon_view_set_text_column ##### -->
<para>
</para>
@icon_view:
@column:
<!-- ##### FUNCTION gtk_icon_view_get_text_column ##### -->
<para>
</para>
@icon_view:
@Returns:
<!-- ##### FUNCTION gtk_icon_view_set_markup_column ##### -->
<para>
</para>
@icon_view:
@column:
<!-- ##### FUNCTION gtk_icon_view_get_markup_column ##### -->
<para>
</para>
@icon_view:
@Returns:
<!-- ##### FUNCTION gtk_icon_view_set_pixbuf_column ##### -->
<para>
</para>
@icon_view:
@column:
<!-- ##### FUNCTION gtk_icon_view_get_pixbuf_column ##### -->
<para>
</para>
@icon_view:
@Returns:
<!-- ##### FUNCTION gtk_icon_view_get_path_at_pos ##### -->
<para>
</para>
@icon_view:
@x:
@y:
@Returns:
<!-- ##### FUNCTION gtk_icon_view_get_item_at_pos ##### -->
<para>
</para>
@icon_view:
@x:
@y:
@path:
@cell:
@Returns:
<!-- ##### FUNCTION gtk_icon_view_convert_widget_to_bin_window_coords ##### -->
<para>
</para>
@icon_view:
@wx:
@wy:
@bx:
@by:
<!-- ##### FUNCTION gtk_icon_view_set_cursor ##### -->
<para>
</para>
@icon_view:
@path:
@cell:
@start_editing:
<!-- ##### FUNCTION gtk_icon_view_get_cursor ##### -->
<para>
</para>
@icon_view:
@path:
@cell:
@Returns:
<!-- ##### FUNCTION gtk_icon_view_selected_foreach ##### -->
<para>
</para>
@icon_view:
@func:
@data:
<!-- ##### FUNCTION gtk_icon_view_set_selection_mode ##### -->
<para>
</para>
@icon_view:
@mode:
<!-- ##### FUNCTION gtk_icon_view_get_selection_mode ##### -->
<para>
</para>
@icon_view:
@Returns:
<!-- ##### FUNCTION gtk_icon_view_set_orientation ##### -->
<para>
</para>
@icon_view:
@orientation:
<!-- ##### FUNCTION gtk_icon_view_get_orientation ##### -->
<para>
</para>
@icon_view:
@Returns:
<!-- ##### FUNCTION gtk_icon_view_set_columns ##### -->
<para>
</para>
@icon_view:
@columns:
<!-- ##### FUNCTION gtk_icon_view_get_columns ##### -->
<para>
</para>
@icon_view:
@Returns:
<!-- ##### FUNCTION gtk_icon_view_set_item_width ##### -->
<para>
</para>
@icon_view:
@item_width:
<!-- ##### FUNCTION gtk_icon_view_get_item_width ##### -->
<para>
</para>
@icon_view:
@Returns:
<!-- ##### FUNCTION gtk_icon_view_set_spacing ##### -->
<para>
</para>
@icon_view:
@spacing:
<!-- ##### FUNCTION gtk_icon_view_get_spacing ##### -->
<para>
</para>
@icon_view:
@Returns:
<!-- ##### FUNCTION gtk_icon_view_set_row_spacing ##### -->
<para>
</para>
@icon_view:
@row_spacing:
<!-- ##### FUNCTION gtk_icon_view_get_row_spacing ##### -->
<para>
</para>
@icon_view:
@Returns:
<!-- ##### FUNCTION gtk_icon_view_set_column_spacing ##### -->
<para>
</para>
@icon_view:
@column_spacing:
<!-- ##### FUNCTION gtk_icon_view_get_column_spacing ##### -->
<para>
</para>
@icon_view:
@Returns:
<!-- ##### FUNCTION gtk_icon_view_set_margin ##### -->
<para>
</para>
@icon_view:
@margin:
<!-- ##### FUNCTION gtk_icon_view_get_margin ##### -->
<para>
</para>
@icon_view:
@Returns:
<!-- ##### FUNCTION gtk_icon_view_set_item_padding ##### -->
<para>
</para>
@icon_view:
@item_padding:
<!-- ##### FUNCTION gtk_icon_view_get_item_padding ##### -->
<para>
</para>
@icon_view:
@Returns:
<!-- ##### FUNCTION gtk_icon_view_select_path ##### -->
<para>
</para>
@icon_view:
@path:
<!-- ##### FUNCTION gtk_icon_view_unselect_path ##### -->
<para>
</para>
@icon_view:
@path:
<!-- ##### FUNCTION gtk_icon_view_path_is_selected ##### -->
<para>
</para>
@icon_view:
@path:
@Returns:
<!-- ##### FUNCTION gtk_icon_view_get_selected_items ##### -->
<para>
</para>
@icon_view:
@Returns:
<!-- ##### FUNCTION gtk_icon_view_select_all ##### -->
<para>
</para>
@icon_view:
<!-- ##### FUNCTION gtk_icon_view_unselect_all ##### -->
<para>
</para>
@icon_view:
<!-- ##### FUNCTION gtk_icon_view_item_activated ##### -->
<para>
</para>
@icon_view:
@path:
<!-- ##### FUNCTION gtk_icon_view_scroll_to_path ##### -->
<para>
</para>
@icon_view:
@path:
@use_align:
@row_align:
@col_align:
<!-- ##### FUNCTION gtk_icon_view_get_visible_range ##### -->
<para>
</para>
@icon_view:
@start_path:
@end_path:
@Returns:
<!-- ##### FUNCTION gtk_icon_view_set_tooltip_item ##### -->
<para>
</para>
@icon_view:
@tooltip:
@path:
<!-- ##### FUNCTION gtk_icon_view_set_tooltip_cell ##### -->
<para>
</para>
@icon_view:
@tooltip:
@path:
@cell:
<!-- ##### FUNCTION gtk_icon_view_get_tooltip_context ##### -->
<para>
</para>
@icon_view:
@x:
@y:
@keyboard_tip:
@model:
@path:
@iter:
@Returns:
<!-- ##### FUNCTION gtk_icon_view_set_tooltip_column ##### -->
<para>
</para>
@icon_view:
@column:
<!-- ##### FUNCTION gtk_icon_view_get_tooltip_column ##### -->
<para>
</para>
@icon_view:
@Returns:
<!-- ##### ENUM GtkIconViewDropPosition ##### -->
<para>
An enum for determining where a dropped item goes.
</para>
@GTK_ICON_VIEW_NO_DROP: no drop possible
@GTK_ICON_VIEW_DROP_INTO: dropped item replaces the item
@GTK_ICON_VIEW_DROP_LEFT: droppped item is inserted to the left
@GTK_ICON_VIEW_DROP_RIGHT: dropped item is inserted to the right
@GTK_ICON_VIEW_DROP_ABOVE: dropped item is inserted above
@GTK_ICON_VIEW_DROP_BELOW: dropped item is inserted below
<!-- ##### FUNCTION gtk_icon_view_enable_model_drag_source ##### -->
<para>
</para>
@icon_view:
@start_button_mask:
@targets:
@n_targets:
@actions:
<!-- ##### FUNCTION gtk_icon_view_enable_model_drag_dest ##### -->
<para>
</para>
@icon_view:
@targets:
@n_targets:
@actions:
<!-- ##### FUNCTION gtk_icon_view_unset_model_drag_source ##### -->
<para>
</para>
@icon_view:
<!-- ##### FUNCTION gtk_icon_view_unset_model_drag_dest ##### -->
<para>
</para>
@icon_view:
<!-- ##### FUNCTION gtk_icon_view_set_reorderable ##### -->
<para>
</para>
@icon_view:
@reorderable:
<!-- ##### FUNCTION gtk_icon_view_get_reorderable ##### -->
<para>
</para>
@icon_view:
@Returns:
<!-- ##### FUNCTION gtk_icon_view_set_drag_dest_item ##### -->
<para>
</para>
@icon_view:
@path:
@pos:
<!-- ##### FUNCTION gtk_icon_view_get_drag_dest_item ##### -->
<para>
</para>
@icon_view:
@path:
@pos:
<!-- ##### FUNCTION gtk_icon_view_get_dest_item_at_pos ##### -->
<para>
</para>
@icon_view:
@drag_x:
@drag_y:
@path:
@pos:
@Returns:
<!-- ##### FUNCTION gtk_icon_view_create_drag_icon ##### -->
<para>
</para>
@icon_view:
@path:
@Returns:
+165
View File
@@ -0,0 +1,165 @@
<!-- ##### SECTION Title ##### -->
GtkStatusbar
<!-- ##### SECTION Short_Description ##### -->
Report messages of minor importance to the user
<!-- ##### SECTION Long_Description ##### -->
<para>
A #GtkStatusbar is usually placed along the bottom of an application's main
#GtkWindow. It may provide a regular commentary of the application's status
(as is usually the case in a web browser, for example), or may be used to
simply output a message when the status changes, (when an upload is complete
in an FTP client, for example).
It may also have a resize grip (a triangular area in the lower right corner)
which can be clicked on to resize the window containing the statusbar.
</para>
<para>
Status bars in GTK+ maintain a stack of messages. The message at
the top of the each bar's stack is the one that will currently be displayed.
</para>
<para>
Any messages added to a statusbar's stack must specify a <emphasis>context
id</emphasis> that is used to uniquely identify the source of a message.
This context id can be generated by gtk_statusbar_get_context_id(), given a
message and the statusbar that it will be added to. Note that messages are
stored in a stack, and when choosing which message to display, the stack
structure is adhered to, regardless of the context identifier of a message.
</para>
<para>
One could say that a statusbar maintains one stack of messages for display
purposes, but allows multiple message producers to maintain sub-stacks of
the messages they produced (via context ids).
</para>
<para>
Status bars are created using gtk_statusbar_new().
</para>
<para>
Messages are added to the bar's stack with gtk_statusbar_push().
</para>
<para>
The message at the top of the stack can be removed using gtk_statusbar_pop().
A message can be removed from anywhere in the stack if its message_id was
recorded at the time it was added. This is done using gtk_statusbar_remove().
</para>
<!-- ##### SECTION See_Also ##### -->
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### SECTION Image ##### -->
<!-- ##### STRUCT GtkStatusbar ##### -->
<para>
Contains private data that should be modified with the functions described
below.
</para>
<!-- ##### SIGNAL GtkStatusbar::text-popped ##### -->
<para>
</para>
@statusbar:
@context_id:
@text:
<!-- ##### SIGNAL GtkStatusbar::text-pushed ##### -->
<para>
</para>
@statusbar:
@context_id:
@text:
<!-- ##### ARG GtkStatusbar:has-resize-grip ##### -->
<para>
</para>
<!-- ##### ARG GtkStatusbar:shadow-type ##### -->
<para>
</para>
<!-- ##### FUNCTION gtk_statusbar_new ##### -->
<para>
</para>
@void:
@Returns:
<!-- ##### FUNCTION gtk_statusbar_get_context_id ##### -->
<para>
</para>
@statusbar:
@context_description:
@Returns:
<!-- ##### FUNCTION gtk_statusbar_push ##### -->
<para>
</para>
@statusbar:
@context_id:
@text:
@Returns:
<!-- ##### FUNCTION gtk_statusbar_pop ##### -->
<para>
</para>
@statusbar:
@context_id:
<!-- ##### FUNCTION gtk_statusbar_remove ##### -->
<para>
</para>
@statusbar:
@context_id:
@message_id:
<!-- ##### FUNCTION gtk_statusbar_set_has_resize_grip ##### -->
<para>
</para>
@statusbar:
@setting:
<!-- ##### FUNCTION gtk_statusbar_get_has_resize_grip ##### -->
<para>
</para>
@statusbar:
@Returns:
<!-- ##### FUNCTION gtk_statusbar_get_message_area ##### -->
<para>
</para>
@statusbar:
@Returns:
File diff suppressed because it is too large Load Diff
+1 -2
View File
@@ -223,7 +223,7 @@ GdkX11_3_0_gir_SCANNERFLAGS = --strip-prefix=gdk_x11 --add-include-path=../gdk-p
GdkX11_3_0_gir_INCLUDES = Gio-2.0 Gdk-3.0 GdkPixbuf-3.0 Pango-1.0 xlib-2.0
GdkX11_3_0_gir_LIBS = $(gdktargetlib)
GdkX11_3_0_gir_FILES = $(addprefix $(srcdir)/,$(x11_introspection_files))
GdkX11_3_0_gir_CFLAGS = $(INCLUDES) -L$(top_builddir)/gdk
GdkX11_3_0_gir_CFLAGS = $(INCLUDES)
INTROSPECTION_GIRS += GdkX11-3.0.gir
endif # USE_X11
@@ -274,7 +274,6 @@ gdkalias.h: gdk.symbols
gdkaliasdef.c: gdk.symbols
$(PERL) $(srcdir)/makegdkalias.pl -def < $(srcdir)/gdk.symbols > gdkaliasdef.c
TESTS_ENVIRONMENT = srcdir="$(srcdir)"
if OS_LINUX
TESTS = abicheck.sh pltcheck.sh
endif
+1 -1
View File
@@ -1,5 +1,5 @@
#! /bin/sh
cpp -DINCLUDE_VARIABLES -P -DALL_FILES -DGDK_ENABLE_BROKEN -include ../config.h -include ./gdkconfig.h ${srcdir:-.}/gdk.symbols | sed -e '/^$/d' -e 's/ G_GNUC.*$//' | sort | uniq > expected-abi
cpp -DINCLUDE_VARIABLES -P -DALL_FILES -DGDK_ENABLE_BROKEN -include ${srcdir:-.}/../config.h -include ${srcdir:-.}/gdkconfig.h ${srcdir:-.}/gdk.symbols | sed -e '/^$/d' -e 's/ G_GNUC.*$//' | sort | uniq > expected-abi
nm -D -g --defined-only .libs/libgdk-x11-3.0.so | cut -d ' ' -f 3 | egrep -v '^(__bss_start|_edata|_end)' | sort > actual-abi
diff -u expected-abi actual-abi && rm -f expected-abi actual-abi
-16
View File
@@ -30,22 +30,6 @@
#include <gdkdisplay.h>
#include "gdkalias.h"
/**
* SECTION:dnd
* @title: Drag And Drop
* @short_description: Functions for controlling drag and drop handling
*
* These functions provide a low level interface for drag and drop.
* The X backend of GDK supports both the Xdnd and Motif drag and drop
* protocols transparently, the Win32 backend supports the WM_DROPFILES
* protocol.
*
* GTK+ provides a higher level abstraction based on top of these functions,
* and so they are not normally needed in GTK+ applications.
* See the <link linkend="gtk-Drag-and-Drop">Drag and Drop</link> section of
* the GTK+ documentation for more information.
*/
/**
* gdk_drag_find_window:
* @context: a #GdkDragContext.
+1 -2
View File
@@ -550,14 +550,13 @@ gdk_window_class_init (GdkWindowObjectClass *klass)
/* Properties */
/**
* GdkWindow:cursor:
*
* The mouse pointer for a #GdkWindow. See gdk_window_set_cursor() and
* gdk_window_get_cursor() for details.
*
* Since: 2.18
* Since: 2.20
*/
g_object_class_install_property (object_class,
PROP_CURSOR,
+52 -1
View File
@@ -238,6 +238,36 @@ gdk_screen_get_root_window (GdkScreen *screen)
return GDK_SCREEN_X11 (screen)->root_window;
}
static gboolean
should_disable_rgba ()
{
static gint should_disable = -1;
if (should_disable == -1)
{
if (g_getenv ("GTK_RGBA_DISABLE_APPS"))
{
gchar **apps = g_strsplit (g_getenv ("GTK_RGBA_DISABLE_APPS"), ":", -1);
gchar *name = g_get_prgname ();
gint i;
should_disable = FALSE;
for (i = 0; apps[i] != NULL; i++)
{
if (g_strcmp0 (apps[i], name) == 0)
{
g_strfreev (apps);
should_disable = TRUE;
break;
}
}
}
}
return should_disable;
}
/**
* gdk_screen_get_default_colormap:
* @screen: a #GdkScreen
@@ -251,9 +281,30 @@ gdk_screen_get_root_window (GdkScreen *screen)
GdkColormap *
gdk_screen_get_default_colormap (GdkScreen *screen)
{
GdkScreenX11 *screen_x11;
GdkColormap *colormap;
gboolean disable_rgba = should_disable_rgba ();
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
return GDK_SCREEN_X11 (screen)->default_colormap;
screen_x11 = GDK_SCREEN_X11 (screen);
if (!screen_x11->default_colormap)
{
if (!screen_x11->rgba_visual || disable_rgba == TRUE)
{
colormap = g_object_ref (gdk_screen_get_system_colormap (screen));
}
else
{
colormap = gdk_colormap_new (screen_x11->rgba_visual,
FALSE);
}
screen_x11->default_colormap = colormap;
}
return screen_x11->default_colormap;
}
/**
-3
View File
@@ -432,9 +432,6 @@ _gdk_windowing_window_init (GdkScreen * screen)
g_assert (screen_x11->root_window == NULL);
gdk_screen_set_default_colormap (screen,
gdk_screen_get_system_colormap (screen));
screen_x11->root_window = g_object_new (GDK_TYPE_WINDOW, NULL);
private = (GdkWindowObject *) screen_x11->root_window;
-2
View File
@@ -410,7 +410,6 @@ gtk_private_h_sources = \
gtktoolpaletteprivate.h \
gtktreedatalist.h \
gtktreeprivate.h \
gtkwindow-decorate.h \
$(gtk_clipboard_dnd_h_sources)
# GTK+ C sources to build the library from
@@ -630,7 +629,6 @@ gtk_base_c_sources = \
gtkvscrollbar.c \
gtkvseparator.c \
gtkwidget.c \
gtkwindow-decorate.c \
gtkwindow.c \
$(gtk_clipboard_dnd_c_sources)
+2
View File
@@ -887,12 +887,14 @@ gtk_container_unset_focus_chain
#if IN_HEADER(__GTK_WINDOW_DECORATE_H__)
#if IN_FILE(__GTK_WINDOW_DECORATE_C__)
#ifndef GTK_DISABLE_DEPRECATED
gtk_decorated_window_calculate_frame_size
gtk_decorated_window_init
gtk_decorated_window_move_resize_window
gtk_decorated_window_set_title
#endif
#endif
#endif
#if IN_HEADER(__GTK_DIALOG_H__)
#if IN_FILE(__GTK_DIALOG_C__)
+7 -5
View File
@@ -1486,11 +1486,13 @@ _gtk_button_paint (GtkButton *button,
if (button->relief != GTK_RELIEF_NONE || button->depressed ||
gtk_widget_get_state(widget) == GTK_STATE_PRELIGHT)
gtk_paint_box (widget->style, widget->window,
state_type,
shadow_type, area, widget, "button",
x, y, width, height);
{
gtk_paint_box (widget->style, widget->window,
state_type,
shadow_type, area, widget, "button",
x, y, width, height);
}
if (gtk_widget_has_focus (widget))
{
gint child_displacement_x;
-13
View File
@@ -43,19 +43,6 @@
#include "gtkprivate.h"
#include "gtkalias.h"
/**
* SECTION:gtkiconview
* @title: GtkIconView
* @short_description: A widget which displays a list of icons in a grid
*
* #GtkIconView provides an alternative view on a list model.
* It displays the model as a grid of icons with labels. Like
* #GtkTreeView, it allows to select one or multiple items
* (depending on the selection mode, see gtk_icon_view_set_selection_mode()).
* In addition to selection with the arrow keys, #GtkIconView supports
* rubberband selection, which is controlled by dragging the pointer.
*/
#undef DEBUG_ICON_VIEW
#define SCROLL_EDGE_SIZE 15
+4 -1
View File
@@ -188,6 +188,7 @@ gtk_plug_class_init (GtkPlugClass *class)
GDK_TYPE_WINDOW,
GTK_PARAM_READABLE));
/**
* GtkPlug::embedded:
* @plug: the object on which the signal was emitted
@@ -554,7 +555,9 @@ gtk_plug_new_for_display (GdkDisplay *display,
{
GtkPlug *plug;
plug = g_object_new (GTK_TYPE_PLUG, NULL);
plug = g_object_new (GTK_TYPE_PLUG,
"disable-client-side-decorations", TRUE,
NULL);
gtk_plug_construct_for_display (plug, display, socket_id);
return GTK_WIDGET (plug);
}
-38
View File
@@ -36,44 +36,6 @@
#include "gtkbuildable.h"
#include "gtkalias.h"
/**
* SECTION:gtkstatusbar
* @title: GtkStatusbar
* @short_description: Report messages of minor importance to the user
*
* A #GtkStatusbar is usually placed along the bottom of an application's
* main #GtkWindow. It may provide a regular commentary of the application's
* status (as is usually the case in a web browser, for example), or may be
* used to simply output a message when the status changes, (when an upload
* is complete in an FTP client, for example).
* It may also have a resize grip (a triangular area in the lower right
* corner) which can be clicked on to resize the window containing the
* statusbar.
*
* Status bars in GTK+ maintain a stack of messages. The message at
* the top of the each bar's stack is the one that will currently be displayed.
*
* Any messages added to a statusbar's stack must specify a
* <emphasis>context id</emphasis> that is used to uniquely identify
* the source of a message. This context id can be generated by
* gtk_statusbar_get_context_id(), given a message and the statusbar that
* it will be added to. Note that messages are stored in a stack, and when
* choosing which message to display, the stack structure is adhered to,
* regardless of the context identifier of a message.
*
* One could say that a statusbar maintains one stack of messages for
* display purposes, but allows multiple message producers to maintain
* sub-stacks of the messages they produced (via context ids).
*
* Status bars are created using gtk_statusbar_new().
*
* Messages are added to the bar's stack with gtk_statusbar_push().
*
* The message at the top of the stack can be removed using
* gtk_statusbar_pop(). A message can be removed from anywhere in the
* stack if its message id was recorded at the time it was added. This
* is done using gtk_statusbar_remove().
*/
typedef struct _GtkStatusbarMsg GtkStatusbarMsg;
struct _GtkStatusbarMsg
-6
View File
@@ -44,12 +44,6 @@ G_BEGIN_DECLS
#define GTK_STATUSBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_STATUSBAR, GtkStatusbarClass))
/**
* GtkStatusbar:
*
* Contains private data that should be modified with the functions
* described below.
*/
typedef struct _GtkStatusbar GtkStatusbar;
typedef struct _GtkStatusbarClass GtkStatusbarClass;
+131 -2
View File
@@ -2763,6 +2763,127 @@ option_menu_get_props (GtkWidget *widget,
*indicator_spacing = default_option_indicator_spacing;
}
static void
paint_decorated_window (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
const GdkRectangle *area,
GtkWidget *widget,
const gchar *detail,
gint x,
gint y,
gint width,
gint height)
{
cairo_pattern_t *gradient;
cairo_t *cr;
const double hmargin = x;
const double vmargin = y;
const double radius;
GdkColor *normal_color;
GdkColor *selected_color;
GdkWindowState state;
if (width == -1)
width = widget->allocation.width - 2 * x;
if (height == -1)
height = widget->allocation.height - 2 * y;
state = gdk_window_get_state (window);
gtk_widget_style_get (widget,
"decoration-corner-radius", &radius,
NULL);
cr = gdk_cairo_create (window);
cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
cairo_paint (cr);
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
if (state & GDK_WINDOW_STATE_MAXIMIZED)
{
cairo_rectangle (cr,
0, 0,
width, height);
}
else
{
cairo_move_to (cr, hmargin, vmargin + radius);
cairo_arc (cr, hmargin + radius, vmargin + radius,
radius, M_PI, 3 * M_PI / 2);
cairo_line_to (cr, width - hmargin - radius, vmargin);
cairo_arc (cr, width - hmargin - radius, vmargin + radius,
radius, 3 * M_PI / 2, 2 * M_PI);
cairo_line_to (cr, width - hmargin, height - vmargin - radius);
cairo_arc (cr, width - hmargin - radius, height - vmargin - radius,
radius, 0, M_PI / 2);
cairo_line_to (cr, hmargin + radius, height - vmargin);
cairo_arc (cr, hmargin + radius, height - vmargin - radius,
radius, M_PI / 2, M_PI);
cairo_close_path (cr);
}
cairo_close_path (cr);
#if 0
gradient = cairo_pattern_create_linear (width / 2 - 1,
vmargin,
width / 2 + 1,
height);
#else
gradient = cairo_pattern_create_linear (0,
vmargin,
0,
18); // XXX - TODO
#endif
selected_color = &style->base[GTK_STATE_SELECTED];
normal_color = &style->base[GTK_STATE_NORMAL];
if (GTK_IS_WINDOW (widget) &&
gtk_window_has_toplevel_focus (GTK_WINDOW (widget)) &&
gtk_window_is_active (GTK_WINDOW (widget)))
{
//color = &style->bg[GTK_STATE_SELECTED];
}
else
{
//color = &style->bg[GTK_STATE_NORMAL];
}
cairo_pattern_add_color_stop_rgba (gradient, 0,
normal_color->red / 65535.,
normal_color->green / 65535.,
normal_color->blue / 65535., 1.0);
cairo_pattern_add_color_stop_rgba (gradient, 0.9,
selected_color->red / 65535.,
selected_color->green / 65535.,
selected_color->blue / 65535., 1.0);
cairo_set_source (cr, gradient);
cairo_fill_preserve (cr);
gdk_cairo_set_source_color (cr, &style->fg[state_type]);
cairo_set_line_width (cr, 1);
cairo_set_line_join (cr, CAIRO_LINE_JOIN_ROUND);
cairo_stroke (cr);
cairo_set_source_rgba (cr,
selected_color->red / 65535.,
selected_color->green / 65535.,
selected_color->blue / 65535., 1.0);
cairo_rectangle (cr,
0,
widget->allocation.height - height,
widget->allocation.width,
widget->allocation.height);
cairo_destroy (cr);
}
static void
gtk_default_draw_box (GtkStyle *style,
GdkWindow *window,
@@ -2861,8 +2982,16 @@ gtk_default_draw_box (GtkStyle *style,
return;
}
gtk_paint_shadow (style, window, state_type, shadow_type, area, widget, detail,
x, y, width, height);
if (detail && strcmp (detail, "decoration") == 0)
{
paint_decorated_window (style, window, state_type, shadow_type,
area, widget, detail, x, y, width, height);
}
else
{
gtk_paint_shadow (style, window, state_type, shadow_type,
area, widget, detail, x, y, width, height);
}
if (detail && strcmp (detail, "optionmenu") == 0)
{
+23 -42
View File
@@ -1154,8 +1154,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
/**
* GtkWidget::button-press-event:
* @widget: the object which received the signal.
* @event: (type Gdk.EventButton): the #GdkEventButton which triggered
* this signal.
* @event: the #GdkEventButton which triggered this signal
*
* The ::button-press-event signal will be emitted when a button
* (typically from a mouse) is pressed.
@@ -1181,8 +1180,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
/**
* GtkWidget::button-release-event:
* @widget: the object which received the signal.
* @event: (type Gdk.EventButton): the #GdkEventButton which triggered
* this signal.
* @event: the #GdkEventButton which triggered this signal
*
* The ::button-release-event signal will be emitted when a button
* (typically from a mouse) is released.
@@ -1208,8 +1206,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
/**
* GtkWidget::scroll-event:
* @widget: the object which received the signal.
* @event: (type Gdk.EventScroll): the #GdkEventScroll which triggered
* this signal.
* @event: the #GdkEventScroll which triggered this signal
*
* The ::scroll-event signal is emitted when a button in the 4 to 7
* range is pressed. Wheel mice are usually configured to generate
@@ -1235,8 +1232,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
/**
* GtkWidget::motion-notify-event:
* @widget: the object which received the signal.
* @event: (type Gdk.EventMotion): the #GdkEventMotion which triggered
* this signal.
* @event: the #GdkEventMotion which triggered this signal
*
* The ::motion-notify-event signal is emitted when the pointer moves
* over the widget's #GdkWindow.
@@ -1354,8 +1350,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
/**
* GtkWidget::expose-event:
* @widget: the object which received the signal.
* @event: (type Gdk.EventExpose): the #GdkEventExpose which triggered
* this signal.
* @event: the #GdkEventExpose which triggered this signal
*
* The ::expose-event signal is emitted when an area of a previously
* obscured #GdkWindow is made visible and needs to be redrawn.
@@ -1381,7 +1376,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
/**
* GtkWidget::key-press-event:
* @widget: the object which received the signal
* @event: (type Gdk.EventKey): the #GdkEventKey which triggered this signal.
* @event: the #GdkEventKey which triggered this signal
*
* The ::key-press-event signal is emitted when a key is pressed.
*
@@ -1406,7 +1401,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
/**
* GtkWidget::key-release-event:
* @widget: the object which received the signal
* @event: (type Gdk.EventKey): the #GdkEventKey which triggered this signal.
* @event: the #GdkEventKey which triggered this signal
*
* The ::key-release-event signal is emitted when a key is pressed.
*
@@ -1431,8 +1426,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
/**
* GtkWidget::enter-notify-event:
* @widget: the object which received the signal
* @event: (type Gdk.EventCrossing): the #GdkEventCrossing which triggered
* this signal.
* @event: the #GdkEventCrossing which triggered this signal
*
* The ::enter-notify-event will be emitted when the pointer enters
* the @widget's window.
@@ -1458,8 +1452,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
/**
* GtkWidget::leave-notify-event:
* @widget: the object which received the signal
* @event: (type Gdk.EventCrossing): the #GdkEventCrossing which triggered
* this signal.
* @event: the #GdkEventCrossing which triggered this signal
*
* The ::leave-notify-event will be emitted when the pointer leaves
* the @widget's window.
@@ -1485,8 +1478,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
/**
* GtkWidget::configure-event
* @widget: the object which received the signal
* @event: (type Gdk.EventConfigure): the #GdkEventConfigure which triggered
* this signal.
* @event: the #GdkEventConfigure which triggered this signal
*
* The ::configure-event signal will be emitted when the size, position or
* stacking of the @widget's window has changed.
@@ -1511,8 +1503,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
/**
* GtkWidget::focus-in-event
* @widget: the object which received the signal
* @event: (type Gdk.EventFocus): the #GdkEventFocus which triggered
* this signal.
* @event: the #GdkEventFocus which triggered this signal
*
* The ::focus-in-event signal will be emitted when the keyboard focus
* enters the @widget's window.
@@ -1536,8 +1527,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
/**
* GtkWidget::focus-out-event
* @widget: the object which received the signal
* @event: (type Gdk.EventFocus): the #GdkEventFocus which triggered this
* signal.
* @event: the #GdkEventFocus which triggered this signal
*
* The ::focus-out-event signal will be emitted when the keyboard focus
* leaves the @widget's window.
@@ -1561,7 +1551,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
/**
* GtkWidget::map-event
* @widget: the object which received the signal
* @event: (type Gdk.EventAny): the #GdkEventAny which triggered this signal.
* @event: the #GdkEventAny which triggered this signal
*
* The ::map-event signal will be emitted when the @widget's window is
* mapped. A window is mapped when it becomes visible on the screen.
@@ -1586,7 +1576,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
/**
* GtkWidget::unmap-event
* @widget: the object which received the signal
* @event: (type Gdk.EventAny): the #GdkEventAny which triggered this signal
* @event: the #GdkEventAny which triggered this signal
*
* The ::unmap-event signal may be emitted when the @widget's window is
* unmapped. A window is unmapped when it becomes invisible on the screen.
@@ -1615,8 +1605,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
/**
* GtkWidget::property-notify-event
* @widget: the object which received the signal
* @event: (type Gdk.EventProperty): the #GdkEventProperty which triggered
* this signal.
* @event: the #GdkEventProperty which triggered this signal
*
* The ::property-notify-event signal will be emitted when a property on
* the @widget's window has been changed or deleted.
@@ -1640,8 +1629,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
/**
* GtkWidget::selection-clear-event
* @widget: the object which received the signal
* @event: (type Gdk.EventSelection): the #GdkEventSelection which triggered
* this signal.
* @event: the #GdkEventSelection which triggered this signal
*
* The ::selection-clear-event signal will be emitted when the
* the @widget's window has lost ownership of a selection.
@@ -1662,8 +1650,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
/**
* GtkWidget::selection-request-event
* @widget: the object which received the signal
* @event: (type Gdk.EventSelection): the #GdkEventSelection which triggered
* this signal.
* @event: the #GdkEventSelection which triggered this signal
*
* The ::selection-request-event signal will be emitted when
* another client requests ownership of the selection owned by
@@ -1738,8 +1725,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
/**
* GtkWidget::proximity-in-event
* @widget: the object which received the signal
* @event: (type Gdk.EventProximity): the #GdkEventProximity which triggered
* this signal.
* @event: the #GdkEventProximity which triggered this signal
*
* To receive this signal the #GdkWindow associated to the widget needs
* to enable the #GDK_PROXIMITY_IN_MASK mask.
@@ -1762,8 +1748,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
/**
* GtkWidget::proximity-out-event
* @widget: the object which received the signal
* @event: (type Gdk.EventProximity): the #GdkEventProximity which triggered
* this signal.
* @event: the #GdkEventProximity which triggered this signal
*
* To receive this signal the #GdkWindow associated to the widget needs
* to enable the #GDK_PROXIMITY_OUT_MASK mask.
@@ -2142,8 +2127,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
/**
* GtkWidget::visibility-notify-event:
* @widget: the object which received the signal
* @event: (type Gdk.EventVisibility): the #GdkEventVisibility which
* triggered this signal.
* @event: the #GdkEventVisibility which triggered this signal
*
* The ::visibility-notify-event will be emitted when the @widget's window
* is obscured or unobscured.
@@ -2167,8 +2151,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
/**
* GtkWidget::client-event:
* @widget: the object which received the signal
* @event: (type Gdk.EventClient): the #GdkEventClient which triggered
* this signal.
* @event: the #GdkEventClient which triggered this signal
*
* The ::client-event will be emitted when the @widget's window
* receives a message (via a ClientMessage event) from another
@@ -2190,8 +2173,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
/**
* GtkWidget::no-expose-event:
* @widget: the object which received the signal
* @event: (type Gdk.EventNoExpose): the #GdkEventNoExpose which triggered
* this signal.
* @event: the #GdkEventNoExpose which triggered this signal
*
* The ::no-expose-event will be emitted when the @widget's window is
* drawn as a copy of another #GdkDrawable (with gdk_draw_drawable())
@@ -2215,8 +2197,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
/**
* GtkWidget::window-state-event:
* @widget: the object which received the signal
* @event: (type Gdk.EventWindowState): the #GdkEventWindowState which
* triggered this signal.
* @event: the #GdkEventWindowState which triggered this signal
*
* The ::window-state-event will be emitted when the state of the
* toplevel window associated to the @widget changes.
+4
View File
@@ -22,6 +22,10 @@
*/
#include "config.h"
#undef GTK_DISABLE_DEPRECATED
#define __GTK_WINDOW_DECORATE_C__
#include "gtkprivate.h"
#include "gtkwindow.h"
#include "gtkmain.h"
+4
View File
@@ -21,6 +21,8 @@
* Authors: Alexander Larsson <alexl@redhat.com>
*/
#if !defined(GTK_DISABLE_DEPRECATED) || defined(__GTK_WINDOW_DECORATE_C__)
#ifndef __GTK_WINDOW_DECORATE_H__
#define __GTK_WINDOW_DECORATE_H__
@@ -39,3 +41,5 @@ void gtk_decorated_window_move_resize_window (GtkWindow *window,
G_END_DECLS
#endif /* __GTK_WINDOW_DECORATE_H__ */
#endif /* GTK_DISABLE_DEPRECATED */
+1987 -228
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -138,7 +138,7 @@ struct _GtkWindowClass
GtkDirectionType direction);
void (*keys_changed) (GtkWindow *window);
/* Padding for future expansion */
void (*_gtk_reserved1) (void);
void (*_gtk_reserved2) (void);
+98
View File
@@ -0,0 +1,98 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* This is the same as Mutter's common.h, but stripped-down to have
* only the types and macros required by the theming code.
*/
/* Mutter common types shared by core.h and ui.h */
/*
* Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2005 Elijah Newren
*
* 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 2 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#ifndef META_COMMON_H
#define META_COMMON_H
/* Don't include GTK or core headers here */
#include <glib.h>
typedef enum
{
META_FRAME_ALLOWS_DELETE = 1 << 0,
META_FRAME_ALLOWS_MENU = 1 << 1,
META_FRAME_ALLOWS_MINIMIZE = 1 << 2,
META_FRAME_ALLOWS_MAXIMIZE = 1 << 3,
META_FRAME_ALLOWS_VERTICAL_RESIZE = 1 << 4,
META_FRAME_ALLOWS_HORIZONTAL_RESIZE = 1 << 5,
META_FRAME_HAS_FOCUS = 1 << 6,
META_FRAME_SHADED = 1 << 7,
META_FRAME_STUCK = 1 << 8,
META_FRAME_MAXIMIZED = 1 << 9,
META_FRAME_ALLOWS_SHADE = 1 << 10,
META_FRAME_ALLOWS_MOVE = 1 << 11,
META_FRAME_FULLSCREEN = 1 << 12,
META_FRAME_IS_FLASHING = 1 << 13,
META_FRAME_ABOVE = 1 << 14
} MetaFrameFlags;
typedef enum
{
META_FRAME_TYPE_NORMAL,
META_FRAME_TYPE_DIALOG,
META_FRAME_TYPE_MODAL_DIALOG,
META_FRAME_TYPE_UTILITY,
META_FRAME_TYPE_MENU,
META_FRAME_TYPE_BORDER,
META_FRAME_TYPE_LAST
} MetaFrameType;
/* Function a window button can have. Note, you can't add stuff here
* without extending the theme format to draw a new function and
* breaking all existing themes.
*/
typedef enum
{
META_BUTTON_FUNCTION_MENU,
META_BUTTON_FUNCTION_MINIMIZE,
META_BUTTON_FUNCTION_MAXIMIZE,
META_BUTTON_FUNCTION_CLOSE,
META_BUTTON_FUNCTION_SHADE,
META_BUTTON_FUNCTION_ABOVE,
META_BUTTON_FUNCTION_STICK,
META_BUTTON_FUNCTION_UNSHADE,
META_BUTTON_FUNCTION_UNABOVE,
META_BUTTON_FUNCTION_UNSTICK,
META_BUTTON_FUNCTION_LAST
} MetaButtonFunction;
#define MAX_BUTTONS_PER_CORNER META_BUTTON_FUNCTION_LAST
typedef struct _MetaButtonLayout MetaButtonLayout;
struct _MetaButtonLayout
{
/* buttons in the group on the left side */
MetaButtonFunction left_buttons[MAX_BUTTONS_PER_CORNER];
gboolean left_buttons_has_spacer[MAX_BUTTONS_PER_CORNER];
/* buttons in the group on the right side */
MetaButtonFunction right_buttons[MAX_BUTTONS_PER_CORNER];
gboolean right_buttons_has_spacer[MAX_BUTTONS_PER_CORNER];
};
#endif
+841
View File
@@ -0,0 +1,841 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* Metacity gradient rendering */
/*
* Copyright (C) 2001 Havoc Pennington, 99% copied from wrlib in
* WindowMaker, Copyright (C) 1997-2000 Dan Pascu and Alfredo Kojima
* Copyright (C) 2005 Elijah Newren
*
* 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 2 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA. */
#include "meta-gradient.h"
#include <string.h>
/* This is all Alfredo's and Dan's usual very nice WindowMaker code,
* slightly GTK-ized
*/
static GdkPixbuf* meta_gradient_create_horizontal (int width,
int height,
const GdkColor *from,
const GdkColor *to);
static GdkPixbuf* meta_gradient_create_vertical (int width,
int height,
const GdkColor *from,
const GdkColor *to);
static GdkPixbuf* meta_gradient_create_diagonal (int width,
int height,
const GdkColor *from,
const GdkColor *to);
static GdkPixbuf* meta_gradient_create_multi_horizontal (int width,
int height,
const GdkColor *colors,
int count);
static GdkPixbuf* meta_gradient_create_multi_vertical (int width,
int height,
const GdkColor *colors,
int count);
static GdkPixbuf* meta_gradient_create_multi_diagonal (int width,
int height,
const GdkColor *colors,
int count);
/* Used as the destroy notification function for gdk_pixbuf_new() */
static void
free_buffer (guchar *pixels, gpointer data)
{
g_free (pixels);
}
static GdkPixbuf*
blank_pixbuf (int width, int height, gboolean no_padding)
{
guchar *buf;
int rowstride;
g_return_val_if_fail (width > 0, NULL);
g_return_val_if_fail (height > 0, NULL);
if (no_padding)
rowstride = width * 3;
else
/* Always align rows to 32-bit boundaries */
rowstride = 4 * ((3 * width + 3) / 4);
buf = g_try_malloc (height * rowstride);
if (!buf)
return NULL;
return gdk_pixbuf_new_from_data (buf, GDK_COLORSPACE_RGB,
FALSE, 8,
width, height, rowstride,
free_buffer, NULL);
}
GdkPixbuf*
meta_gradient_create_simple (int width,
int height,
const GdkColor *from,
const GdkColor *to,
MetaGradientType style)
{
switch (style)
{
case META_GRADIENT_HORIZONTAL:
return meta_gradient_create_horizontal (width, height,
from, to);
case META_GRADIENT_VERTICAL:
return meta_gradient_create_vertical (width, height,
from, to);
case META_GRADIENT_DIAGONAL:
return meta_gradient_create_diagonal (width, height,
from, to);
case META_GRADIENT_LAST:
break;
}
g_assert_not_reached ();
return NULL;
}
GdkPixbuf*
meta_gradient_create_multi (int width,
int height,
const GdkColor *colors,
int n_colors,
MetaGradientType style)
{
if (n_colors > 2)
{
switch (style)
{
case META_GRADIENT_HORIZONTAL:
return meta_gradient_create_multi_horizontal (width, height, colors, n_colors);
case META_GRADIENT_VERTICAL:
return meta_gradient_create_multi_vertical (width, height, colors, n_colors);
case META_GRADIENT_DIAGONAL:
return meta_gradient_create_multi_diagonal (width, height, colors, n_colors);
case META_GRADIENT_LAST:
g_assert_not_reached ();
break;
}
}
else if (n_colors > 1)
{
return meta_gradient_create_simple (width, height, &colors[0], &colors[1],
style);
}
else if (n_colors > 0)
{
return meta_gradient_create_simple (width, height, &colors[0], &colors[0],
style);
}
g_assert_not_reached ();
return NULL;
}
/* Interwoven essentially means we have two vertical gradients,
* cut into horizontal strips of the given thickness, and then the strips
* are alternated. I'm not sure what it's good for, just copied since
* WindowMaker had it.
*/
GdkPixbuf*
meta_gradient_create_interwoven (int width,
int height,
const GdkColor colors1[2],
int thickness1,
const GdkColor colors2[2],
int thickness2)
{
int i, j, k, l, ll;
long r1, g1, b1, dr1, dg1, db1;
long r2, g2, b2, dr2, dg2, db2;
GdkPixbuf *pixbuf;
unsigned char *ptr;
unsigned char *pixels;
int rowstride;
pixbuf = blank_pixbuf (width, height, FALSE);
if (pixbuf == NULL)
return NULL;
pixels = gdk_pixbuf_get_pixels (pixbuf);
rowstride = gdk_pixbuf_get_rowstride (pixbuf);
r1 = colors1[0].red<<8;
g1 = colors1[0].green<<8;
b1 = colors1[0].blue<<8;
r2 = colors2[0].red<<8;
g2 = colors2[0].green<<8;
b2 = colors2[0].blue<<8;
dr1 = ((colors1[1].red-colors1[0].red)<<8)/(int)height;
dg1 = ((colors1[1].green-colors1[0].green)<<8)/(int)height;
db1 = ((colors1[1].blue-colors1[0].blue)<<8)/(int)height;
dr2 = ((colors2[1].red-colors2[0].red)<<8)/(int)height;
dg2 = ((colors2[1].green-colors2[0].green)<<8)/(int)height;
db2 = ((colors2[1].blue-colors2[0].blue)<<8)/(int)height;
for (i=0,k=0,l=0,ll=thickness1; i<height; i++)
{
ptr = pixels + i * rowstride;
if (k == 0)
{
ptr[0] = (unsigned char) (r1>>16);
ptr[1] = (unsigned char) (g1>>16);
ptr[2] = (unsigned char) (b1>>16);
}
else
{
ptr[0] = (unsigned char) (r2>>16);
ptr[1] = (unsigned char) (g2>>16);
ptr[2] = (unsigned char) (b2>>16);
}
for (j=1; j <= width/2; j *= 2)
memcpy (&(ptr[j*3]), ptr, j*3);
memcpy (&(ptr[j*3]), ptr, (width - j)*3);
if (++l == ll)
{
if (k == 0)
{
k = 1;
ll = thickness2;
}
else
{
k = 0;
ll = thickness1;
}
l = 0;
}
r1+=dr1;
g1+=dg1;
b1+=db1;
r2+=dr2;
g2+=dg2;
b2+=db2;
}
return pixbuf;
}
/*
*----------------------------------------------------------------------
* meta_gradient_create_horizontal--
* Renders a horizontal linear gradient of the specified size in the
* GdkPixbuf format with a border of the specified type.
*
* Returns:
* A 24bit GdkPixbuf with the gradient (no alpha channel).
*
* Side effects:
* None
*----------------------------------------------------------------------
*/
static GdkPixbuf*
meta_gradient_create_horizontal (int width, int height,
const GdkColor *from,
const GdkColor *to)
{
int i;
long r, g, b, dr, dg, db;
GdkPixbuf *pixbuf;
unsigned char *ptr;
unsigned char *pixels;
int r0, g0, b0;
int rf, gf, bf;
int rowstride;
pixbuf = blank_pixbuf (width, height, FALSE);
if (pixbuf == NULL)
return NULL;
pixels = gdk_pixbuf_get_pixels (pixbuf);
ptr = pixels;
rowstride = gdk_pixbuf_get_rowstride (pixbuf);
r0 = (guchar) (from->red / 256.0);
g0 = (guchar) (from->green / 256.0);
b0 = (guchar) (from->blue / 256.0);
rf = (guchar) (to->red / 256.0);
gf = (guchar) (to->green / 256.0);
bf = (guchar) (to->blue / 256.0);
r = r0 << 16;
g = g0 << 16;
b = b0 << 16;
dr = ((rf-r0)<<16)/(int)width;
dg = ((gf-g0)<<16)/(int)width;
db = ((bf-b0)<<16)/(int)width;
/* render the first line */
for (i=0; i<width; i++)
{
*(ptr++) = (unsigned char)(r>>16);
*(ptr++) = (unsigned char)(g>>16);
*(ptr++) = (unsigned char)(b>>16);
r += dr;
g += dg;
b += db;
}
/* copy the first line to the other lines */
for (i=1; i<height; i++)
{
memcpy (&(pixels[i*rowstride]), pixels, rowstride);
}
return pixbuf;
}
/*
*----------------------------------------------------------------------
* meta_gradient_create_vertical--
* Renders a vertical linear gradient of the specified size in the
* GdkPixbuf format with a border of the specified type.
*
* Returns:
* A 24bit GdkPixbuf with the gradient (no alpha channel).
*
* Side effects:
* None
*----------------------------------------------------------------------
*/
static GdkPixbuf*
meta_gradient_create_vertical (int width, int height,
const GdkColor *from,
const GdkColor *to)
{
int i, j;
long r, g, b, dr, dg, db;
GdkPixbuf *pixbuf;
unsigned char *ptr;
int r0, g0, b0;
int rf, gf, bf;
int rowstride;
unsigned char *pixels;
pixbuf = blank_pixbuf (width, height, FALSE);
if (pixbuf == NULL)
return NULL;
pixels = gdk_pixbuf_get_pixels (pixbuf);
rowstride = gdk_pixbuf_get_rowstride (pixbuf);
r0 = (guchar) (from->red / 256.0);
g0 = (guchar) (from->green / 256.0);
b0 = (guchar) (from->blue / 256.0);
rf = (guchar) (to->red / 256.0);
gf = (guchar) (to->green / 256.0);
bf = (guchar) (to->blue / 256.0);
r = r0<<16;
g = g0<<16;
b = b0<<16;
dr = ((rf-r0)<<16)/(int)height;
dg = ((gf-g0)<<16)/(int)height;
db = ((bf-b0)<<16)/(int)height;
for (i=0; i<height; i++)
{
ptr = pixels + i * rowstride;
ptr[0] = (unsigned char)(r>>16);
ptr[1] = (unsigned char)(g>>16);
ptr[2] = (unsigned char)(b>>16);
for (j=1; j <= width/2; j *= 2)
memcpy (&(ptr[j*3]), ptr, j*3);
memcpy (&(ptr[j*3]), ptr, (width - j)*3);
r+=dr;
g+=dg;
b+=db;
}
return pixbuf;
}
/*
*----------------------------------------------------------------------
* meta_gradient_create_diagonal--
* Renders a diagonal linear gradient of the specified size in the
* GdkPixbuf format with a border of the specified type.
*
* Returns:
* A 24bit GdkPixbuf with the gradient (no alpha channel).
*
* Side effects:
* None
*----------------------------------------------------------------------
*/
static GdkPixbuf*
meta_gradient_create_diagonal (int width, int height,
const GdkColor *from,
const GdkColor *to)
{
GdkPixbuf *pixbuf, *tmp;
int j;
float a, offset;
unsigned char *ptr;
unsigned char *pixels;
int rowstride;
if (width == 1)
return meta_gradient_create_vertical (width, height, from, to);
else if (height == 1)
return meta_gradient_create_horizontal (width, height, from, to);
pixbuf = blank_pixbuf (width, height, FALSE);
if (pixbuf == NULL)
return NULL;
pixels = gdk_pixbuf_get_pixels (pixbuf);
rowstride = gdk_pixbuf_get_rowstride (pixbuf);
tmp = meta_gradient_create_horizontal (2*width-1, 1, from, to);
if (!tmp)
{
g_object_unref (G_OBJECT (pixbuf));
return NULL;
}
ptr = gdk_pixbuf_get_pixels (tmp);
a = ((float)(width - 1))/((float)(height - 1));
width = width * 3;
/* copy the first line to the other lines with corresponding offset */
for (j=0, offset=0.0; j<rowstride*height; j += rowstride)
{
memcpy (&(pixels[j]), &ptr[3*(int)offset], width);
offset += a;
}
g_object_unref (G_OBJECT (tmp));
return pixbuf;
}
static GdkPixbuf*
meta_gradient_create_multi_horizontal (int width, int height,
const GdkColor *colors,
int count)
{
int i, j, k;
long r, g, b, dr, dg, db;
GdkPixbuf *pixbuf;
unsigned char *ptr;
unsigned char *pixels;
int width2;
int rowstride;
g_return_val_if_fail (count > 2, NULL);
pixbuf = blank_pixbuf (width, height, FALSE);
if (pixbuf == NULL)
return NULL;
pixels = gdk_pixbuf_get_pixels (pixbuf);
rowstride = gdk_pixbuf_get_rowstride (pixbuf);
ptr = pixels;
if (count > width)
count = width;
if (count > 1)
width2 = width/(count-1);
else
width2 = width;
k = 0;
r = colors[0].red << 8;
g = colors[0].green << 8;
b = colors[0].blue << 8;
/* render the first line */
for (i=1; i<count; i++)
{
dr = ((int)(colors[i].red - colors[i-1].red) <<8)/(int)width2;
dg = ((int)(colors[i].green - colors[i-1].green)<<8)/(int)width2;
db = ((int)(colors[i].blue - colors[i-1].blue) <<8)/(int)width2;
for (j=0; j<width2; j++)
{
*ptr++ = (unsigned char)(r>>16);
*ptr++ = (unsigned char)(g>>16);
*ptr++ = (unsigned char)(b>>16);
r += dr;
g += dg;
b += db;
k++;
}
r = colors[i].red << 8;
g = colors[i].green << 8;
b = colors[i].blue << 8;
}
for (j=k; j<width; j++)
{
*ptr++ = (unsigned char)(r>>16);
*ptr++ = (unsigned char)(g>>16);
*ptr++ = (unsigned char)(b>>16);
}
/* copy the first line to the other lines */
for (i=1; i<height; i++)
{
memcpy (&(pixels[i*rowstride]), pixels, rowstride);
}
return pixbuf;
}
static GdkPixbuf*
meta_gradient_create_multi_vertical (int width, int height,
const GdkColor *colors,
int count)
{
int i, j, k;
long r, g, b, dr, dg, db;
GdkPixbuf *pixbuf;
unsigned char *ptr, *tmp, *pixels;
int height2;
int x;
int rowstride;
g_return_val_if_fail (count > 2, NULL);
pixbuf = blank_pixbuf (width, height, FALSE);
if (pixbuf == NULL)
return NULL;
pixels = gdk_pixbuf_get_pixels (pixbuf);
rowstride = gdk_pixbuf_get_rowstride (pixbuf);
ptr = pixels;
if (count > height)
count = height;
if (count > 1)
height2 = height/(count-1);
else
height2 = height;
k = 0;
r = colors[0].red << 8;
g = colors[0].green << 8;
b = colors[0].blue << 8;
for (i=1; i<count; i++)
{
dr = ((int)(colors[i].red - colors[i-1].red) <<8)/(int)height2;
dg = ((int)(colors[i].green - colors[i-1].green)<<8)/(int)height2;
db = ((int)(colors[i].blue - colors[i-1].blue) <<8)/(int)height2;
for (j=0; j<height2; j++)
{
ptr[0] = (unsigned char)(r>>16);
ptr[1] = (unsigned char)(g>>16);
ptr[2] = (unsigned char)(b>>16);
for (x=1; x <= width/2; x *= 2)
memcpy (&(ptr[x*3]), ptr, x*3);
memcpy (&(ptr[x*3]), ptr, (width - x)*3);
ptr += rowstride;
r += dr;
g += dg;
b += db;
k++;
}
r = colors[i].red << 8;
g = colors[i].green << 8;
b = colors[i].blue << 8;
}
if (k<height)
{
tmp = ptr;
ptr[0] = (unsigned char) (r>>16);
ptr[1] = (unsigned char) (g>>16);
ptr[2] = (unsigned char) (b>>16);
for (x=1; x <= width/2; x *= 2)
memcpy (&(ptr[x*3]), ptr, x*3);
memcpy (&(ptr[x*3]), ptr, (width - x)*3);
ptr += rowstride;
for (j=k+1; j<height; j++)
{
memcpy (ptr, tmp, rowstride);
ptr += rowstride;
}
}
return pixbuf;
}
static GdkPixbuf*
meta_gradient_create_multi_diagonal (int width, int height,
const GdkColor *colors,
int count)
{
GdkPixbuf *pixbuf, *tmp;
float a, offset;
int j;
unsigned char *ptr;
unsigned char *pixels;
int rowstride;
g_return_val_if_fail (count > 2, NULL);
if (width == 1)
return meta_gradient_create_multi_vertical (width, height, colors, count);
else if (height == 1)
return meta_gradient_create_multi_horizontal (width, height, colors, count);
pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8,
width, height);
if (pixbuf == NULL)
return NULL;
pixels = gdk_pixbuf_get_pixels (pixbuf);
rowstride = gdk_pixbuf_get_rowstride (pixbuf);
if (count > width)
count = width;
if (count > height)
count = height;
if (count > 2)
tmp = meta_gradient_create_multi_horizontal (2*width-1, 1, colors, count);
else
/* wrlib multiplies these colors by 256 before passing them in, but
* I think it's a bug in wrlib, so changed here. I could be wrong
* though, if we notice two-color multi diagonals not working.
*/
tmp = meta_gradient_create_horizontal (2*width-1, 1,
&colors[0], &colors[1]);
if (!tmp)
{
g_object_unref (G_OBJECT (pixbuf));
return NULL;
}
ptr = gdk_pixbuf_get_pixels (tmp);
a = ((float)(width - 1))/((float)(height - 1));
width = width * 3;
/* copy the first line to the other lines with corresponding offset */
for (j=0, offset=0; j<rowstride*height; j += rowstride)
{
memcpy (&(pixels[j]), &ptr[3*(int)offset], width);
offset += a;
}
g_object_unref (G_OBJECT (tmp));
return pixbuf;
}
static void
simple_multiply_alpha (GdkPixbuf *pixbuf,
guchar alpha)
{
guchar *pixels;
int rowstride;
int height;
int row;
g_return_if_fail (GDK_IS_PIXBUF (pixbuf));
if (alpha == 255)
return;
g_assert (gdk_pixbuf_get_has_alpha (pixbuf));
pixels = gdk_pixbuf_get_pixels (pixbuf);
rowstride = gdk_pixbuf_get_rowstride (pixbuf);
height = gdk_pixbuf_get_height (pixbuf);
row = 0;
while (row < height)
{
guchar *p;
guchar *end;
p = pixels + row * rowstride;
end = p + rowstride;
while (p != end)
{
p += 3; /* skip RGB */
/* multiply the two alpha channels. not sure this is right.
* but some end cases are that if the pixbuf contains 255,
* then it should be modified to contain "alpha"; if the
* pixbuf contains 0, it should remain 0.
*/
/* ((*p / 255.0) * (alpha / 255.0)) * 255; */
*p = (guchar) (((int) *p * (int) alpha) / (int) 255);
++p; /* skip A */
}
++row;
}
}
static void
meta_gradient_add_alpha_horizontal (GdkPixbuf *pixbuf,
const unsigned char *alphas,
int n_alphas)
{
int i, j;
long a, da;
unsigned char *p;
unsigned char *pixels;
int width2;
int rowstride;
int width, height;
unsigned char *gradient;
unsigned char *gradient_p;
unsigned char *gradient_end;
g_return_if_fail (n_alphas > 0);
if (n_alphas == 1)
{
/* Optimize this */
simple_multiply_alpha (pixbuf, alphas[0]);
return;
}
width = gdk_pixbuf_get_width (pixbuf);
height = gdk_pixbuf_get_height (pixbuf);
gradient = g_new (unsigned char, width);
gradient_end = gradient + width;
if (n_alphas > width)
n_alphas = width;
if (n_alphas > 1)
width2 = width / (n_alphas - 1);
else
width2 = width;
a = alphas[0] << 8;
gradient_p = gradient;
/* render the gradient into an array */
for (i = 1; i < n_alphas; i++)
{
da = (((int)(alphas[i] - (int) alphas[i-1])) << 8) / (int) width2;
for (j = 0; j < width2; j++)
{
*gradient_p++ = (a >> 8);
a += da;
}
a = alphas[i] << 8;
}
/* get leftover pixels */
while (gradient_p != gradient_end)
{
*gradient_p++ = a >> 8;
}
/* Now for each line of the pixbuf, fill in with the gradient */
pixels = gdk_pixbuf_get_pixels (pixbuf);
rowstride = gdk_pixbuf_get_rowstride (pixbuf);
p = pixels;
i = 0;
while (i < height)
{
unsigned char *row_end = p + rowstride;
gradient_p = gradient;
p += 3;
while (gradient_p != gradient_end)
{
/* multiply the two alpha channels. not sure this is right.
* but some end cases are that if the pixbuf contains 255,
* then it should be modified to contain "alpha"; if the
* pixbuf contains 0, it should remain 0.
*/
/* ((*p / 255.0) * (alpha / 255.0)) * 255; */
*p = (guchar) (((int) *p * (int) *gradient_p) / (int) 255);
p += 4;
++gradient_p;
}
p = row_end;
++i;
}
g_free (gradient);
}
void
meta_gradient_add_alpha (GdkPixbuf *pixbuf,
const guchar *alphas,
int n_alphas,
MetaGradientType type)
{
g_return_if_fail (GDK_IS_PIXBUF (pixbuf));
g_return_if_fail (gdk_pixbuf_get_has_alpha (pixbuf));
g_return_if_fail (n_alphas > 0);
switch (type)
{
case META_GRADIENT_HORIZONTAL:
meta_gradient_add_alpha_horizontal (pixbuf, alphas, n_alphas);
break;
case META_GRADIENT_VERTICAL:
g_printerr ("metacity: vertical alpha channel gradient not implemented yet\n");
break;
case META_GRADIENT_DIAGONAL:
g_printerr ("metacity: diagonal alpha channel gradient not implemented yet\n");
break;
case META_GRADIENT_LAST:
g_assert_not_reached ();
break;
}
}
+65
View File
@@ -0,0 +1,65 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* Mutter gradient rendering */
/*
* Copyright (C) 2001 Havoc Pennington, 99% copied from wrlib in
* WindowMaker, Copyright (C) 1997-2000 Dan Pascu and Alfredo Kojima
*
* 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 2 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA. */
#ifndef META_GRADIENT_H
#define META_GRADIENT_H
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gdk/gdk.h>
typedef enum
{
META_GRADIENT_VERTICAL,
META_GRADIENT_HORIZONTAL,
META_GRADIENT_DIAGONAL,
META_GRADIENT_LAST
} MetaGradientType;
GdkPixbuf* meta_gradient_create_simple (int width,
int height,
const GdkColor *from,
const GdkColor *to,
MetaGradientType style);
GdkPixbuf* meta_gradient_create_multi (int width,
int height,
const GdkColor *colors,
int n_colors,
MetaGradientType style);
GdkPixbuf* meta_gradient_create_interwoven (int width,
int height,
const GdkColor colors1[2],
int thickness1,
const GdkColor colors2[2],
int thickness2);
/* Generate an alpha gradient and multiply it with the existing alpha
* channel of the given pixbuf
*/
void meta_gradient_add_alpha (GdkPixbuf *pixbuf,
const guchar *alphas,
int n_alphas,
MetaGradientType type);
#endif
File diff suppressed because it is too large Load Diff
+32
View File
@@ -0,0 +1,32 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* Metacity theme parsing */
/*
* Copyright (C) 2001 Havoc Pennington
*
* 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 2 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#include "meta-theme.h"
#ifndef META_THEME_PARSER_H
#define META_THEME_PARSER_H
MetaTheme* meta_theme_load (const char *theme_name,
GError **err);
#endif
+6686
View File
File diff suppressed because it is too large Load Diff
+1194
View File
File diff suppressed because it is too large Load Diff
-1
View File
@@ -75,7 +75,6 @@ test_type (gconstpointer data)
/* These can't be freely constructed/destroyed */
if (g_type_is_a (type, GTK_TYPE_PRINT_JOB) ||
g_type_is_a (type, GTK_TYPE_APPLICATION) ||
g_type_is_a (type, GDK_TYPE_PIXBUF_LOADER) ||
g_type_is_a (type, gdk_pixbuf_simple_anim_iter_get_type ()))
return;
+3 -3
View File
@@ -223,8 +223,8 @@ gail_window_real_initialize (AtkObject *obj,
const gchar *name;
name = gtk_widget_get_name (widget);
if (!g_strcmp0 (name, "gtk-tooltip"))
if (name && (!strcmp (name, "gtk-tooltip") ||
!strcmp (name, "gtk-tooltips")))
obj->role = ATK_ROLE_TOOL_TIP;
else if (GTK_IS_PLUG (widget))
obj->role = ATK_ROLE_PANEL;
@@ -416,7 +416,7 @@ gail_window_ref_relation_set (AtkObject *obj)
{
atk_relation_set_remove (relation_set, relation);
}
if (gtk_widget_get_visible(widget) && FALSE /* FIXME gtk_tooltips_get_info_from_tip_window (GTK_WINDOW (widget), NULL, &current_widget) */)
if (gtk_widget_get_visible(widget) && gtk_tooltips_get_info_from_tip_window (GTK_WINDOW (widget), NULL, &current_widget))
{
array [0] = gtk_widget_get_accessible (current_widget);
+1 -1
View File
@@ -184,7 +184,7 @@ maintainer-clean: distclean
rm -f $(GMOFILES)
distdir = ../$(GETTEXT_PACKAGE)-$(VERSION)/$(subdir)
dist distdir: $(DISTFILES)
dist distdir: update-po $(DISTFILES)
dists="$(DISTFILES)"; \
for file in $$dists; do \
ln $(srcdir)/$$file $(distdir) 2> /dev/null \
+1 -1
View File
@@ -203,7 +203,7 @@ maintainer-clean: distclean
rm -f $(GMOFILES)
distdir = ../$(GETTEXT_PACKAGE)-$(VERSION)/$(subdir)
dist distdir: $(DISTFILES)
dist distdir: update-po $(DISTFILES)
dists="$(DISTFILES)"; \
for file in $$dists; do \
ln $(srcdir)/$$file $(distdir) 2> /dev/null \