~ubuntu-branches/ubuntu/hardy/uim/hardy

« back to all changes in this revision

Viewing changes to helper/toolbar-standalone-gtk.c

  • Committer: Bazaar Package Importer
  • Author(s): Steinar H. Gunderson
  • Date: 2006-07-06 22:17:24 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20060706221724-6sobw1fcsxj647hp
Tags: 1:1.1.0-1.2
* Non-maintainer upload.
* Added -Wno-cast-align to CFLAGS, as per the RM's recommendations:

  < vorlon> Sesse: -Wno-cast-align and to hell with it :P

  Really fixes FTBFS. (Really Closes: #375081)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
  toolbar-standalone-gtk.c: toolbar implementation with GTK+
4
4
 
5
 
  Copyright (c) 2003-2005 uim Project http://uim.freedesktop.org/
 
5
  Copyright (c) 2003-2006 uim Project http://uim.freedesktop.org/
6
6
 
7
7
  All rights reserved.
8
8
 
42
42
#include <gtk/gtk.h>
43
43
#include "uim/uim.h"
44
44
 
45
 
extern GtkWidget *uim_helper_toolbar_new(void);
 
45
extern GtkWidget *uim_toolbar_standalone_new(void);
46
46
 
47
47
static gboolean toolbar_dragging = FALSE;
48
48
static gint window_drag_start_x = -1, window_drag_start_y = -1;
73
73
  gdk_pointer_grab(widget->window, FALSE,
74
74
                   GDK_BUTTON_RELEASE_MASK |
75
75
                   GDK_POINTER_MOTION_MASK,
76
 
                   NULL, 
 
76
                   NULL,
77
77
                   cursor, event->time);
78
 
  gdk_cursor_destroy (cursor); 
 
78
  gdk_cursor_destroy (cursor);
79
79
 
80
80
  gtk_window_get_position(GTK_WINDOW(widget),
81
81
                          &window_drag_start_x,
156
156
                   GTK_STATE_NORMAL, GTK_SHADOW_OUT,
157
157
                   rect, widget, "handlebox",
158
158
                   widget->allocation.x, widget->allocation.y,
159
 
                   widget->allocation.width, widget->allocation.height, 
 
159
                   widget->allocation.width, widget->allocation.height,
160
160
                   GTK_ORIENTATION_VERTICAL);
161
161
 
162
162
  return FALSE;
179
179
  if (GTK_WIDGET_MAPPED(widget)) {
180
180
    gint width, height;
181
181
    gtk_window_get_size(GTK_WINDOW(widget), &width, &height);
182
 
    
183
 
    if (width != req->width || height != req->height) {
 
182
 
 
183
    if (width > req->width) {
184
184
      gtk_window_resize(GTK_WINDOW(widget), req->width, req->height);
185
185
    }
186
186
  }
187
187
}
188
188
 
189
 
int 
 
189
int
190
190
main (int argc, char *argv[])
191
191
{
192
192
  GtkWidget *toolbar;
203
203
  uim_init();
204
204
 
205
205
  gtk_set_locale();
206
 
  
 
206
 
207
207
  gtk_init(&argc, &argv);
208
208
 
209
209
  window = gtk_window_new(GTK_WINDOW_POPUP);
241
241
  gtk_widget_set_size_request(handle, 8, -1);
242
242
  gtk_box_pack_start(GTK_BOX (hbox), handle, FALSE, FALSE, 0);
243
243
 
244
 
  toolbar = (GtkWidget*)uim_helper_toolbar_new();
 
244
  toolbar = (GtkWidget*)uim_toolbar_standalone_new();
245
245
  gtk_box_pack_start(GTK_BOX (hbox), toolbar, FALSE, FALSE, 0);
246
246
  g_signal_connect(G_OBJECT(window), "size-request",
247
247
                   G_CALLBACK(size_request_cb), NULL);