/* Utilities */
static gint 
hildon_program_window_list_compare              (gconstpointer window_a, 
                                                 gconstpointer window_b)
{
    g_return_val_if_fail (HILDON_IS_WINDOW(window_a) && 
                          HILDON_IS_WINDOW(window_b), 1);

    return window_a != window_b;
}
/* 
 * Checks if the window is the topmost window of the program and in
 * that case forces the window to take the common toolbar.
 */
static void
hildon_program_common_toolbar_topmost_window    (gpointer window, 
                                                 gpointer data)
{
    if (HILDON_IS_WINDOW (window) && hildon_window_get_is_topmost (HILDON_WINDOW (window)))
        hildon_window_take_common_toolbar (HILDON_WINDOW (window));
}
/*
 * foreach function, checks if a window is topmost and acts consequently
 */
static void
hildon_program_window_list_is_is_topmost        (gpointer data, 
                                                 gpointer window_id_)
{
    if (data && HILDON_IS_WINDOW (data))
    {
        HildonWindow *window = HILDON_WINDOW (data);
        Window window_id = * (Window*)window_id_;

        hildon_window_update_topmost (window, window_id);
    }
}
static void
fx_setup_default_note ()
{
    int argc = 0;

    gtk_init(&argc, NULL);

    n_window = GTK_WINDOW(hildon_window_new());
    /* Check window object has been created properly */
    fail_if(!HILDON_IS_WINDOW(n_window),
            "hildon-note: Window creation failed.");
}
static void 
fx_setup_default_banner ()
{
  int argc = 0;
  gtk_init(&argc, NULL);
  
  b_window = create_test_window();

 /* Check window object has been created properly */
  fail_if(!HILDON_IS_WINDOW(b_window),
          "hildon-banner: Window creation failed.");

  
}
static void
fx_setup_default_time_picker ()
{
  int argc = 0;
  gtk_init(&argc, NULL);

  tp_window = HILDON_WINDOW(hildon_window_new());
 /* Check window object has been created properly */
  fail_if(!HILDON_IS_WINDOW(tp_window),
          "hildon-time-picker: Window creation failed.");

  time_picker = HILDON_TIME_PICKER(hildon_time_picker_new(GTK_WINDOW(tp_window)));

  /* Check time_picker object has been created properly */
  fail_if(!HILDON_IS_TIME_PICKER(time_picker),
          "hildon-time-picker: Creation failed.");

  /* Displays the widget and the window */
  show_all_test_window (GTK_WIDGET (tp_window));
  show_all_test_window (GTK_WIDGET (time_picker));

}
Beispiel #7
0
wxTopLevelWindowGTK::~wxTopLevelWindowGTK()
{
    if ( m_netFrameExtentsTimerId )
    {
        // Don't let the timer callback fire as the window pointer passed to it
        // will become invalid very soon.
        g_source_remove(m_netFrameExtentsTimerId);
    }

#if wxUSE_LIBHILDON || wxUSE_LIBHILDON2
    // it can also be a (standard) dialog
    if ( HILDON_IS_WINDOW(m_widget) )
    {
        hildon_program_remove_window(wxTheApp->GetHildonProgram(),
                                     HILDON_WINDOW(m_widget));
    }
#endif // wxUSE_LIBHILDON || wxUSE_LIBHILDON2

    if (m_grabbed)
    {
        wxFAIL_MSG(wxT("Window still grabbed"));
        RemoveGrab();
    }

    SendDestroyEvent();

    // it may also be GtkScrolledWindow in the case of an MDI child
    if (GTK_IS_WINDOW(m_widget))
    {
        gtk_window_set_focus( GTK_WINDOW(m_widget), NULL );
    }

    if (g_activeFrame == this)
        g_activeFrame = NULL;
    if (g_lastActiveFrame == this)
        g_lastActiveFrame = NULL;
}
gboolean
configure_event_cb (GtkWidget *widget, GdkEvent *event, gpointer user_data)
{
	GtkWidget *toolbar_widget;

	g_return_val_if_fail(widget != NULL && HILDON_IS_WINDOW(widget), FALSE);
	g_return_val_if_fail(event->type == GDK_CONFIGURE, FALSE);
	g_return_val_if_fail(user_data != NULL, FALSE);

	AppUIData *app_ui_data = (AppUIData *) user_data;
	GdkEventConfigure *configure_event = (GdkEventConfigure*)event;

	if (configure_event->height > configure_event->width) 
	{
		/* Portrait mode */
		app_ui_data->isPortrait = TRUE;
		gtk_tool_item_set_expand(app_ui_data->current_page_item, FALSE);
		
		if(app_ui_data->current_zoom_item != NULL)
			gtk_container_remove(app_ui_data->toolbar, app_ui_data->current_zoom_item);

		toolbar_widget = gtk_ui_manager_get_widget(app_ui_data->ui_manager,
        					               "/ToolBar/"
							       "pdfv_me_menu_screen_zoom_out");
		if (toolbar_widget != NULL)
	        	gtk_container_remove(app_ui_data->toolbar, toolbar_widget);

		toolbar_widget = gtk_ui_manager_get_widget(app_ui_data->ui_manager,
        					               "/ToolBar/"
							       "pdfv_me_menu_screen_zoom_in");
		if (toolbar_widget != NULL)
	        	gtk_container_remove(app_ui_data->toolbar, toolbar_widget);
	}
	else
	{
		/* Landscape mode */
		app_ui_data->isPortrait = FALSE;
		gtk_tool_item_set_expand(app_ui_data->current_page_item, TRUE);

		if(gtk_toolbar_get_item_index(app_ui_data->toolbar, app_ui_data->current_zoom_item) != TOOLBAR_POS_CURRENT_ZOOM_WIDGET) 
		{
			toolbar_widget = gtk_ui_manager_get_widget(app_ui_data->ui_manager,
        						               "/ToolBar/"
								       "pdfv_me_menu_screen_zoom_out");
			if (toolbar_widget != NULL)
				gtk_toolbar_insert(GTK_TOOLBAR(app_ui_data->toolbar),
        		               toolbar_widget, (TOOLBAR_POS_CURRENT_ZOOM_WIDGET-1));

			if(app_ui_data->current_zoom_item != NULL)
				gtk_toolbar_insert(GTK_TOOLBAR(app_ui_data->toolbar),
        	        	       app_ui_data->current_zoom_item, TOOLBAR_POS_CURRENT_ZOOM_WIDGET);

			toolbar_widget = gtk_ui_manager_get_widget(app_ui_data->ui_manager,
        						               "/ToolBar/"
								       "pdfv_me_menu_screen_zoom_in");
			if (toolbar_widget != NULL)
				gtk_toolbar_insert(GTK_TOOLBAR(app_ui_data->toolbar),
        		               toolbar_widget, (TOOLBAR_POS_CURRENT_ZOOM_WIDGET+1));
		}

	}
	return FALSE;
}